/data/websites/telefonino/web/wp/wp-includes/post.php
*
* @param string $uri Icon directory URI.
*/
$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) );
/**
* Filters the array of icon directory URIs.
*
* @since 2.5.0
*
* @param string[] $uris Array of icon directory URIs keyed by directory absolute path.
*/
$dirs = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );
$icon_files = array();
$all_icons = array();
while ( $dirs ) {
$keys = array_keys( $dirs );
$dir = array_shift( $keys );
$uri = array_shift( $dirs );
$dh = opendir( $dir );
if ( $dh ) {
while ( false !== $file = readdir( $dh ) ) {
$file = wp_basename( $file );
if ( str_starts_with( $file, '.' ) ) {
continue;
}
$ext = strtolower( substr( $file, -4 ) );
if ( ! in_array( $ext, array( '.svg', '.png', '.gif', '.jpg' ), true ) ) {
if ( is_dir( "$dir/$file" ) ) {
$dirs[ "$dir/$file" ] = "$uri/$file";
}
continue;
}
$all_icons[ "$dir/$file" ] = "$uri/$file";
if ( $ext === $preferred_ext ) {
$icon_files[ "$dir/$file" ] = "$uri/$file";
}
}
closedir( $dh );
/data/websites/telefonino/web/wp/wp-includes/post.php
*
* @param string $uri Icon directory URI.
*/
$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) );
/**
* Filters the array of icon directory URIs.
*
* @since 2.5.0
*
* @param string[] $uris Array of icon directory URIs keyed by directory absolute path.
*/
$dirs = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );
$icon_files = array();
$all_icons = array();
while ( $dirs ) {
$keys = array_keys( $dirs );
$dir = array_shift( $keys );
$uri = array_shift( $dirs );
$dh = opendir( $dir );
if ( $dh ) {
while ( false !== $file = readdir( $dh ) ) {
$file = wp_basename( $file );
if ( str_starts_with( $file, '.' ) ) {
continue;
}
$ext = strtolower( substr( $file, -4 ) );
if ( ! in_array( $ext, array( '.svg', '.png', '.gif', '.jpg' ), true ) ) {
if ( is_dir( "$dir/$file" ) ) {
$dirs[ "$dir/$file" ] = "$uri/$file";
}
continue;
}
$all_icons[ "$dir/$file" ] = "$uri/$file";
if ( $ext === $preferred_ext ) {
$icon_files[ "$dir/$file" ] = "$uri/$file";
}
}
closedir( $dh );
/data/websites/telefonino/web/app/plugins/advanced-custom-fields-pro/includes/api/api-helpers.php
'id' => $attachment->ID,
'title' => $attachment->post_title,
'filename' => wp_basename( $attached_file ),
'filesize' => 0,
'url' => wp_get_attachment_url( $attachment->ID ),
'link' => get_attachment_link( $attachment->ID ),
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
'author' => $attachment->post_author,
'description' => $attachment->post_content,
'caption' => $attachment->post_excerpt,
'name' => $attachment->post_name,
'status' => $attachment->post_status,
'uploaded_to' => $attachment->post_parent,
'date' => $attachment->post_date_gmt,
'modified' => $attachment->post_modified_gmt,
'menu_order' => $attachment->menu_order,
'mime_type' => $attachment->post_mime_type,
'type' => $type,
'subtype' => $subtype,
'icon' => wp_mime_type_icon( $attachment->ID ),
);
// Append filesize data.
if ( isset( $meta['filesize'] ) ) {
$response['filesize'] = $meta['filesize'];
} else {
/**
* Allows shortcutting our ACF's `filesize` call to prevent us making filesystem calls.
* Mostly useful for third party plugins which may offload media to other services, and filesize calls will induce a remote download.
*
* @since 6.2.2
*
* @param int|null The default filesize.
* @param WP_Post $attachment The attachment post object we're looking for the filesize for.
*/
$shortcut_filesize = apply_filters( 'acf/filesize', null, $attachment );
if ( $shortcut_filesize ) {
$response['filesize'] = intval( $shortcut_filesize );
} elseif ( file_exists( $attached_file ) ) {
$response['filesize'] = filesize( $attached_file );
/data/websites/telefonino/web/app/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-image.php
function format_value( $value, $post_id, $field ) {
// bail early if no value
if ( empty( $value ) ) {
return false;
}
// bail early if not numeric (error message)
if ( ! is_numeric( $value ) ) {
return false;
}
// convert to int
$value = intval( $value );
// format
if ( $field['return_format'] == 'url' ) {
return wp_get_attachment_url( $value );
} elseif ( $field['return_format'] == 'array' ) {
return acf_get_attachment( $value );
}
// return
return $value;
}
/**
* description
*
* @type function
* @date 27/01/13
* @since 3.6.0
*
* @param $vars (array)
* @return $vars
*/
function get_media_item_args( $vars ) {
$vars['send'] = true;
/data/websites/telefonino/web/wp/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$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, $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.
/data/websites/telefonino/web/wp/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.
/data/websites/telefonino/web/app/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
/data/websites/telefonino/web/wp/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$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, $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.
/data/websites/telefonino/web/wp/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`.
/data/websites/telefonino/web/app/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php
$field_name = $field['name'];
$cache_name = $escape_html ? "$post_id:$field_name:escaped" : "$post_id:$field_name:formatted";
// Check store.
$store = acf_get_store( 'values' );
if ( $store->has( $cache_name ) ) {
return $store->get( $cache_name );
}
/**
* Filters the $value for use in a template function.
*
* @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.
* @param boolean $escape_html Ask the field for a HTML safe version of it's output.
*/
$value = apply_filters( 'acf/format_value', $value, $post_id, $field, $escape_html );
// Update store.
$store->set( $cache_name, $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.
/data/websites/telefonino/web/app/plugins/advanced-custom-fields-pro/includes/api/api-template.php
return false;
}
// format value
if ( $format_value ) {
if ( $escape_html ) {
// return the escaped HTML version if requested.
if ( acf_field_type_supports( $field['type'], 'escaping_html' ) ) {
$value = acf_format_value( $value, $post_id, $field, true );
} else {
$new_value = acf_format_value( $value, $post_id, $field );
if ( is_array( $new_value ) ) {
$value = map_deep( $new_value, 'acf_esc_html' );
} else {
$value = acf_esc_html( $new_value );
}
}
} else {
// get value for field
$value = acf_format_value( $value, $post_id, $field );
}
}
// If we've built a dummy text field, we won't format the value, but they may still request it escaped. Use `acf_esc_html`
if ( $dummy_field && $escape_html ) {
if ( is_array( $value ) ) {
$value = map_deep( $value, 'acf_esc_html' );
} else {
$value = acf_esc_html( $value );
}
}
// return
return $value;
}
/**
* This function is the same as echo get_field(), but will escape the value for safe HTML output regardless of parameters.
*
* @since 1.0.3
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Post/Components/Author.php
function __construct($post_id) {
$this->post_id = $post_id;
}
function getData() {
$author_id = get_post($this->post_id)->post_author;
$author = [
'id' => $author_id,
'email' => get_the_author_meta( 'user_email', $author_id),
'display_name' => get_the_author_meta( 'display_name', $author_id),
'first_name' => get_the_author_meta( 'first_name', $author_id),
'last_name' => get_the_author_meta( 'last_name', $author_id),
'nickname' => get_the_author_meta( 'nickname', $author_id),
'user_firstname' => get_the_author_meta( 'user_firstname', $author_id),
'author_url' => get_author_posts_url( $author_id ),
'avatar' => $this->takeProdAvatarImage( get_field('immagine_autore', 'user_'.$author_id) )
];
return (object) [ 'name' => 'author', 'data' => $author];
}
private function takeProdAvatarImage( $avatar ) {
$avatar[ 'url' ] = (isset($avatar[ 'url' ])) ? $this->takeProdImgUrl( $avatar[ 'url' ] ) : "";
if( !empty( $avatar['sizes'] )) {
foreach( array_keys( $avatar['sizes'] ) as $key ) {
$avatar['sizes'][$key] = $this->takeProdImgUrl( $avatar['sizes'][$key] );
}
}
return $avatar;
}
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php
'Taxonomies',
'Credits',
'Canonical',
'StructuredDataFaq',
'AnalysisTracking',
'Meta'
];
}
/**
* Get data from all the components in the
* $components list
*/
private function setComponents() {
foreach($this->components as $component) {
$component = __NAMESPACE__ .'\\Post\Components\\'. $component;
$component_instance = (new $component( $this->post->ID, $this->data ))->getData();
$this->data[$component_instance->name] = $component_instance->data;
}
}
/**
* questa parte deve essere applicata al content
*
* filter the embeds and removes width attributes
*
* va aggiunto ? comunque in content
*//*
protected function removeWidthAttributes(){
$content = $this->data['post']['content'];
$patterns = [
'/width\s*=\s*".*?"/i',
/data/websites/telefonino/web/app/themes/telefonino/src/ViewModel/Single.php
function __construct($post, $postTemplate = 'Single') {
parent::__construct();
$this->post = $post;
// assign the post template (default is 'Single')
$this->postTemplate = $this->postTemplateFactory($postTemplate);
// init the post template
// (includes content details as well)
$this->setPost();
// set the components list into property
// $components
$this->initComponents();
// add all the default components
$this->setComponents();
}
/**
* Writes the basic page info
*/
protected function setPageData(){
$this->data = [
'type' => 'single_post',
'infinite' => 'true'
];
}
/**
* Add the post info to data
*/
protected function setPost() {
$this->data['post'] = $this->postTemplate->getPostData($this->post);
/data/websites/telefonino/web/app/themes/telefonino/single.php
<?php
use THEME\ViewModel\SingleNews;
use THEME\Utils\Timber;
if (have_posts()) {
$ajax = ( isset( $_GET['is_ajax_request']) );
// load data
$data = ( new SingleNews( $posts[0], 'SingleSplittedContent') )->getData();
$template = $ajax ? 'singleAjax.twig' : 'single-notizia.twig';
Timber::render( $template, $data);
}
?>
/data/websites/telefonino/web/wp/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;
}
/data/websites/telefonino/web/wp/wp-blog-header.php
/data/websites/telefonino/web/index.php
<?php
/**
* WordPress View Bootstrapper
*/
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';