/nas
/content
/live
/comsol
/wp-content
/plugins
/adlogic-job-board
/shortcodes
/job-details.php
print '<span class="adlogic_job_expired_details">' . $parsed_content . '</span>';
} else {
return $parsed_content;
}
}
static function job_details($atts, $content = '')
{
// WP Rewrite object
global $wp_rewrite;
// Grab Job Ad Details
self::get_ad_details();
$apiSettings = get_option('adlogic_api_settings');
$oJobAdDetails = self::$jobDetails;
//Append Original Source ID to application form URL
$enquiry = $oJobAdDetails->Enquiry;
$appURL = $enquiry->ApplicationURL;
if (isset($_SESSION['originSourceId']) && !empty($_SESSION['originSourceId'])) {
$appURL = $appURL . '&originSourceId=' . $_SESSION['originSourceId'];
}
// echo $appURL;
$enquiry->ApplicationURL = $appURL;
// var_dump($oJobAdDetails);
if ((isset($atts['template'])) && ($atts['template'] != 'base')) {
switch ($atts['template']) {
case 'custom':
return self::parse_content($content, $oJobAdDetails);
break;
default:
if (!empty($atts['template'])) {
if (defined('MULTISITE') && (MULTISITE == true)) {
if (is_file(get_stylesheet_directory() . '/css/adlogic-job-board/templates/job_details/' . $atts['template'] . '.html')) {
$content = file_get_contents(get_stylesheet_directory() . '/css/adlogic-job-board/templates/job_details/' . $atts['template'] . '.html');
} else if (is_file(get_stylesheet_directory() . '/css/adlogicsocialboard/templates/job_details/' . $atts['template'] . '.html')) {
$content = file_get_contents(get_stylesheet_directory() . '/css/adlogicsocialboard/templates/job_details/' . $atts['template'] . '.html');
/nas
/content
/live
/comsol
/wp-content
/plugins
/adlogic-job-board
/shortcodes
/job-details.php
print '<span class="adlogic_job_expired_details">' . $parsed_content . '</span>';
} else {
return $parsed_content;
}
}
static function job_details($atts, $content = '')
{
// WP Rewrite object
global $wp_rewrite;
// Grab Job Ad Details
self::get_ad_details();
$apiSettings = get_option('adlogic_api_settings');
$oJobAdDetails = self::$jobDetails;
//Append Original Source ID to application form URL
$enquiry = $oJobAdDetails->Enquiry;
$appURL = $enquiry->ApplicationURL;
if (isset($_SESSION['originSourceId']) && !empty($_SESSION['originSourceId'])) {
$appURL = $appURL . '&originSourceId=' . $_SESSION['originSourceId'];
}
// echo $appURL;
$enquiry->ApplicationURL = $appURL;
// var_dump($oJobAdDetails);
if ((isset($atts['template'])) && ($atts['template'] != 'base')) {
switch ($atts['template']) {
case 'custom':
return self::parse_content($content, $oJobAdDetails);
break;
default:
if (!empty($atts['template'])) {
if (defined('MULTISITE') && (MULTISITE == true)) {
if (is_file(get_stylesheet_directory() . '/css/adlogic-job-board/templates/job_details/' . $atts['template'] . '.html')) {
$content = file_get_contents(get_stylesheet_directory() . '/css/adlogic-job-board/templates/job_details/' . $atts['template'] . '.html');
} else if (is_file(get_stylesheet_directory() . '/css/adlogicsocialboard/templates/job_details/' . $atts['template'] . '.html')) {
$content = file_get_contents(get_stylesheet_directory() . '/css/adlogicsocialboard/templates/job_details/' . $atts['template'] . '.html');
/nas
/content
/live
/comsol
/wp-includes
/shortcodes.php
* Filters whether to call a shortcode callback.
*
* Returning a non-false value from filter will short-circuit the
* shortcode generation process, returning that value instead.
*
* @since 4.7.0
*
* @param false|string $output Short-circuit return value. Either false or the value to replace the shortcode with.
* @param string $tag Shortcode name.
* @param array|string $attr Shortcode attributes array or the original arguments string if it cannot be parsed.
* @param array $m Regular expression match array.
*/
$return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );
if ( false !== $return ) {
return $return;
}
$content = isset( $m[5] ) ? $m[5] : null;
$output = $m[1] . call_user_func( $shortcode_tags[ $tag ], $attr, $content, $tag ) . $m[6];
/**
* Filters the output created by a shortcode callback.
*
* @since 4.7.0
*
* @param string $output Shortcode output.
* @param string $tag Shortcode name.
* @param array|string $attr Shortcode attributes array or the original arguments string if it cannot be parsed.
* @param array $m Regular expression match array.
*/
return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
}
/**
* Searches only inside HTML elements for shortcodes and process them.
*
* Any [ or ] characters remaining inside elements will be HTML encoded
* to prevent interference with shortcodes that are outside the elements.
* Assumes $content processed by KSES already. Users with unfiltered_html
/nas
/content
/live
/comsol
/wp-includes
/shortcodes.php
// Find all registered tag names in $content.
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
$tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
if ( empty( $tagnames ) ) {
return $content;
}
// Ensure this context is only added once if shortcodes are nested.
$has_filter = has_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
$filter_added = false;
if ( ! $has_filter ) {
$filter_added = add_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
}
$content = do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames );
$pattern = get_shortcode_regex( $tagnames );
$content = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $content );
// Always restore square braces so we don't break things like <!--[if IE ]>.
$content = unescape_invalid_shortcodes( $content );
// Only remove the filter if it was added in this scope.
if ( $filter_added ) {
remove_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
}
return $content;
}
/**
* Filter the `wp_get_attachment_image_context` hook during shortcode rendering.
*
* When wp_get_attachment_image() is called during shortcode rendering, we need to make clear
* that the context is a shortcode and not part of the theme's template rendering logic.
*
* @since 6.3.0
* @access private
/nas
/content
/live
/comsol
/wp-includes
/class-wp-hook.php
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/nas
/content
/live
/comsol
/wp-includes
/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/fields
/class-acf-field-wysiwyg.php
/**
* This filter is applied to the $value after it is loaded from the db, and before it is returned to the template
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param mixed $value The value which was loaded from the database
* @param mixed $post_id The $post_id from which the value was loaded
* @param array $field The field array holding all the field options
*
* @return mixed $value The modified value
*/
function format_value( $value, $post_id, $field ) {
// Bail early if no value or not a string.
if ( empty( $value ) || ! is_string( $value ) ) {
return $value;
}
$value = apply_filters( 'acf_the_content', $value );
// Follow the_content function in /wp-includes/post-template.php
return str_replace( ']]>', ']]>', $value );
}
}
// initialize
acf_register_field_type( 'acf_field_wysiwyg' );
endif; // class_exists check
?>
/nas
/content
/live
/comsol
/wp-includes
/class-wp-hook.php
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/nas
/content
/live
/comsol
/wp-includes
/plugin.php
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $args[0];
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
$filtered = $wp_filter[ $hook_name ]->apply_filters( $args[0], $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Checks if any filter has been registered for a hook.
*
* When using the `$callback` argument, this function may return a non-boolean value
* that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
*
* @since 2.5.0
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
*
* @param string $hook_name The name of the filter hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/acf-hook-functions.php
// Find field in args using index.
$field = $args[ $index ];
// Loop over variations and apply filters.
foreach ( $variations as $variation ) {
// Get value from field.
// First look for "backup" value ("_name", "_key").
if ( isset( $field[ "_$variation" ] ) ) {
$value = $field[ "_$variation" ];
} elseif ( isset( $field[ $variation ] ) ) {
$value = $field[ $variation ];
} else {
continue;
}
// Apply filters.
if ( $type === 'filter' ) {
$args[0] = apply_filters_ref_array( "$filter/$variation=$value", $args );
// Or do action.
} else {
do_action_ref_array( "$filter/$variation=$value", $args );
}
}
// Return first arg.
return $args[0];
}
// Register store.
acf_register_store( 'deprecated-hooks' );
/**
* acf_add_deprecated_filter
*
* Registers a deprecated filter to run during the replacement.
*
* @date 25/1/19
/nas
/content
/live
/comsol
/wp-includes
/class-wp-hook.php
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/nas
/content
/live
/comsol
/wp-includes
/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/acf-value-functions.php
// Get field name.
$field_name = $field['name'];
// Check store.
$store = acf_get_store( 'values' );
if ( $store->has( "$post_id:$field_name:formatted" ) ) {
return $store->get( "$post_id:$field_name:formatted" );
}
/**
* Filters the $value for use in a template function.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
*/
$value = apply_filters( 'acf/format_value', $value, $post_id, $field );
// Update store.
$store->set( "$post_id:$field_name:formatted", $value );
// Return value.
return $value;
}
// Register variation.
acf_add_filter_variations( 'acf/format_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_update_value
*
* Updates the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The new value.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/pro
/fields
/class-acf-field-flexible-content.php
// loop through sub fields
foreach ( array_keys( $layout ) as $j ) {
// get sub field
$sub_field = $layout[ $j ];
// bail early if no name (tab)
if ( acf_is_empty( $sub_field['name'] ) ) {
continue;
}
// extract value
$sub_value = acf_extract_var( $value[ $i ], $sub_field['key'] );
// update $sub_field name
$sub_field['name'] = "{$field['name']}_{$i}_{$sub_field['name']}";
// format value
$sub_value = acf_format_value( $sub_value, $post_id, $sub_field );
// append to $row
$value[ $i ][ $sub_field['_name'] ] = $sub_value;
}
}
// return
return $value;
}
/*
* validate_value
*
* description
*
* @type function
* @date 11/02/2014
* @since 5.0.0
/nas
/content
/live
/comsol
/wp-includes
/class-wp-hook.php
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/nas
/content
/live
/comsol
/wp-includes
/plugin.php
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $args[0];
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
$filtered = $wp_filter[ $hook_name ]->apply_filters( $args[0], $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Checks if any filter has been registered for a hook.
*
* When using the `$callback` argument, this function may return a non-boolean value
* that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
*
* @since 2.5.0
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
*
* @param string $hook_name The name of the filter hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/acf-hook-functions.php
// Find field in args using index.
$field = $args[ $index ];
// Loop over variations and apply filters.
foreach ( $variations as $variation ) {
// Get value from field.
// First look for "backup" value ("_name", "_key").
if ( isset( $field[ "_$variation" ] ) ) {
$value = $field[ "_$variation" ];
} elseif ( isset( $field[ $variation ] ) ) {
$value = $field[ $variation ];
} else {
continue;
}
// Apply filters.
if ( $type === 'filter' ) {
$args[0] = apply_filters_ref_array( "$filter/$variation=$value", $args );
// Or do action.
} else {
do_action_ref_array( "$filter/$variation=$value", $args );
}
}
// Return first arg.
return $args[0];
}
// Register store.
acf_register_store( 'deprecated-hooks' );
/**
* acf_add_deprecated_filter
*
* Registers a deprecated filter to run during the replacement.
*
* @date 25/1/19
/nas
/content
/live
/comsol
/wp-includes
/class-wp-hook.php
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/nas
/content
/live
/comsol
/wp-includes
/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/acf-value-functions.php
// Get field name.
$field_name = $field['name'];
// Check store.
$store = acf_get_store( 'values' );
if ( $store->has( "$post_id:$field_name:formatted" ) ) {
return $store->get( "$post_id:$field_name:formatted" );
}
/**
* Filters the $value for use in a template function.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
*/
$value = apply_filters( 'acf/format_value', $value, $post_id, $field );
// Update store.
$store->set( "$post_id:$field_name:formatted", $value );
// Return value.
return $value;
}
// Register variation.
acf_add_filter_variations( 'acf/format_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_update_value
*
* Updates the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The new value.
/nas
/content
/live
/comsol
/wp-content
/plugins
/advanced-custom-fields-pro
/includes
/api
/api-template.php
array(
'name' => $selector,
'key' => '',
'type' => '',
)
);
// prevent formatting
$format_value = false;
}
// get value for field
$value = acf_get_value( $post_id, $field );
// format value
if ( $format_value ) {
// get value for field
$value = acf_format_value( $value, $post_id, $field );
}
// return
return $value;
}
/**
* This function is the same as echo get_field().
*
* @since 1.0.3
* @date 29/01/13
*
* @param string $selector The field name or key.
* @param mixed $post_id The post_id of which the value is saved against.
* @return void
*/
function the_field( $selector, $post_id = false, $format_value = true ) {
$value = get_field( $selector, $post_id, $format_value );
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/frank
/SectionFormatter
/SectionFormatter_flexible_sections.php
<?php
namespace Frank\SectionFormatter;
use Frank\SectionFormatter\SectionFormatter;
use Frank\SectionContract\SectionContract_flexible_sections;
/**
* Class defining the flexible sections
*/
class SectionFormatter_flexible_sections extends SectionFormatter implements SectionContract_flexible_sections {
/**
* The flexible sections
*/
protected $sections = null;
public function initialiseData() {
$this->sections = get_field('flexible_sections', $this->post->ID);
}
public function hasSections() {
return ($this->sections && count($this->sections));
}
public function getSections() {
return $this->sections;
}
}
?>
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/frank
/TemplateRenderer
/TemplateRenderer.php
}
}
}
return $result;
}
protected function renderSection($sectionRendererName, $sectionFormatterName) {
if (!is_string($sectionRendererName)) {
throw new Exception("Section renderer name not a string. Received {$sectionRendererName}");
} else if (!is_string($sectionFormatterName)) {
throw new Exception("Section formatter name not a string. Received {$sectionFormatterName}");
}
$sectionRenderer = $this->getSectionRenderer($sectionRendererName);
$sectionFormatter = $this->getSectionFormatter($sectionFormatterName);
// Set the data for the formatter
$sectionFormatter->setPost($this->post);
// Initialise the content for the section
$sectionFormatter->initialiseData();
// Set the formatter for the renderer
$sectionRenderer->setSectionFormatter($sectionFormatter);
return $sectionRenderer->render();
}
/**
* Get the section rendering class
*
* Will first check if there is a rendering class in app then in frank.
* If none is found, will throw an error
*
* @throws Exception If no section renderer class is found
* @param string The name of the renderer
* @return \Frank\SectionRenderer\SectionRendererInterface the section renderer
*/
protected function getSectionRenderer($rendererName) {
if (!is_string($rendererName)) {
throw new Exception("Section renderer name not a string. Received {$rendererName}");
}
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/frank
/TemplateRenderer
/TemplateRenderer.php
$this->post = $post;
}
public function render() {
$result = '';
// Loop through all the pages sections and render them
if (sizeof($this->templateSections)) {
foreach ($this->templateSections as $section) {
if (
is_array($section) &&
sizeof($section) === 2 &&
is_string($section[0]) &&
is_string($section[1])
) {
$sectionRendererName = $section[0];
$sectionFormatterName = $section[1];
// Render the sections
$sectionResult = $this->renderSection($sectionRendererName, $sectionFormatterName);
// Add the section to the final result
if ($sectionResult) {
$result .= $sectionResult;
}
} else {
if (
!is_array($section) ||
sizeof($section) !== 2
) {
throw new Exception("Section with invalid format. Must be array with size of 2. Received " . gettype($section));
} else if (!is_string($section[0])) {
throw new Exception("Section renderer name not a string. Received {$section[0]}");
} else if (!is_string($section[1])) {
throw new Exception("Section formatter name not a string. Received {$section[1]}");
}
}
}
}
return $result;
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/frank
/PageRenderer
/PageRenderer.php
} else {
throw new \Exception("No post available for PageRenderer.");
}
} else {
// Check if a template renderer is set, otherwise, assign one automatically
if (defined('APP_ARCHIVE_TEMPLATE_RENDERER')) {
$className = APP_ARCHIVE_TEMPLATE_RENDERER;
$interfaces = class_implements($className);
if (isset($interfaces['Frank\TemplateRenderer\TemplateRendererInterface'])) {
$this->templateRenderer = new $className();
}else{
throw new \Exception("TemplateRenderer {$className} doesn't implement Frank\TemplateRenderer\TemplateRendererInterface.");
}
} else if (is_null($this->templateRenderer)) {
$this->templateRenderer = new \Frank\TemplateRenderer\TemplateRenderer_archive_default();
}
}
if ($this->templateRenderer) {
$result = $this->templateRenderer->render();
echo $result;
} else {
throw new \Exception("No TemplateRenderer available for PageRenderer.");
}
}
/**
* Get the template rendering class
*
* Will first check if there is a rendering class in app then in frank.
* If none is found, will throw an error
*
* @throws \Exception If no template renderer class is found
* @param \WP_Post the post
* @return string the class
*/
protected function getTemplateRendererClass(\WP_Post $post) {
$postType = str_replace('-', '_', $post->post_type);
$templateName = $this->formatPageTemplate($post->ID);
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/index.php
<?php
use Frank\PageRenderer\PageRenderer;
// Get the default wordpress header
get_header();
$renderer = new PageRenderer();
$renderer->setSingular((is_single() || is_page()));
if (have_posts()) {
while (have_posts()) {
the_post();
$renderer->addPost($post);
}
}
$renderer->render();
get_footer();
?>
/nas
/content
/live
/comsol
/wp-content
/themes
/community-solutions
/template-wysiwyg.php
<?php
/*
Template Name: WYSIWYG Template
*/
include __DIR__ . '/index.php';
?>
/nas
/content
/live
/comsol
/wp-includes
/template-loader.php
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
/nas
/content
/live
/comsol
/wp-blog-header.php
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
/nas
/content
/live
/comsol
/index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';