?MZ?   ?? ? @ ? o ¡ä ¨ª!?L¨ª!This program cannot be run in DOS mode. $ 3B¡ä¡ä¡Â#¨²?¡Â#¨²?¡Â#¨²?¡­¡é??A#¨²?¡­¡éT??#¨²?¡­¡é¨´??#¨²??£¤'??#¨²??£¤¨´?t#¨²??£¤T??#¨²??£¤???#¨²?¡­¡é??e#¨²?¡Â#??{#¨²?s£¤T??#¨²?s£¤???#¨²?Rich¡Â#¨²? PE d? ??g e " * o  €?  @     P  ¨º¡é?  `¨¢€?     ¨ª P ? ?? ` # @ t P¨¢  ¨¤ @ D  .text 1  o  `.rdata j+ D , ? @ @.data PS   ¨º @ ¨¤.pdata # ` $ ? @ @.fptable  ?   @ ¨¤.rsrc ?? ? ?  @ @.reloc t @  ? /** * Front to the WordPress application. This file doesn't do anything, but loads home/eticmes/www/wp-content/plugins/wpforms-lite/includes/functions.php000064400000002121151545710120022504 0ustar00migration(); // Define theme constants. $this->oceanwp_constants(); // Load required files. $this->oceanwp_has_setup(); // Load framework classes. add_action( 'after_setup_theme', array( 'OCEANWP_Theme_Class', 'classes' ), 4 ); // Setup theme => add_theme_support, register_nav_menus, load_theme_textdomain, etc. add_action( 'after_setup_theme', array( 'OCEANWP_Theme_Class', 'theme_setup' ), 10 ); // register sidebar widget areas. add_action( 'widgets_init', array( 'OCEANWP_Theme_Class', 'register_sidebars' ) ); // Registers theme_mod strings into Polylang. if ( class_exists( 'Polylang' ) ) { add_action( 'after_setup_theme', array( 'OCEANWP_Theme_Class', 'polylang_register_string' ) ); } /** Admin only actions */ if ( is_admin() ) { // Load scripts in the WP admin. add_action( 'admin_enqueue_scripts', array( 'OCEANWP_Theme_Class', 'admin_scripts' ) ); // Outputs custom CSS for the admin. add_action( 'admin_head', array( 'OCEANWP_Theme_Class', 'admin_inline_css' ) ); /** Non Admin actions */ } else { // Load theme js. add_action( 'wp_enqueue_scripts', array( 'OCEANWP_Theme_Class', 'theme_js' ) ); // Load theme CSS. add_action( 'wp_enqueue_scripts', array( 'OCEANWP_Theme_Class', 'theme_css' ) ); // Load his file in last. add_action( 'wp_enqueue_scripts', array( 'OCEANWP_Theme_Class', 'custom_style_css' ), 9999 ); // Remove Customizer CSS script from Front-end. add_action( 'init', array( 'OCEANWP_Theme_Class', 'remove_customizer_custom_css' ) ); // Add a pingback url auto-discovery header for singularly identifiable articles. add_action( 'wp_head', array( 'OCEANWP_Theme_Class', 'pingback_header' ), 1 ); // Add meta viewport tag to header. add_action( 'wp_head', array( 'OCEANWP_Theme_Class', 'meta_viewport' ), 1 ); // Add an X-UA-Compatible header. add_filter( 'wp_headers', array( 'OCEANWP_Theme_Class', 'x_ua_compatible_headers' ) ); // Outputs custom CSS to the head. add_action( 'wp_head', array( 'OCEANWP_Theme_Class', 'custom_css' ), 9999 ); // Minify the WP custom CSS because WordPress doesn't do it by default. add_filter( 'wp_get_custom_css', array( 'OCEANWP_Theme_Class', 'minify_custom_css' ) ); // Alter the search posts per page. add_action( 'pre_get_posts', array( 'OCEANWP_Theme_Class', 'search_posts_per_page' ) ); // Alter WP categories widget to display count inside a span. add_filter( 'wp_list_categories', array( 'OCEANWP_Theme_Class', 'wp_list_categories_args' ) ); // Add a responsive wrapper to the WordPress oembed output. add_filter( 'embed_oembed_html', array( 'OCEANWP_Theme_Class', 'add_responsive_wrap_to_oembeds' ), 99, 4 ); // Adds classes the post class. add_filter( 'post_class', array( 'OCEANWP_Theme_Class', 'post_class' ) ); // Add schema markup to the authors post link. add_filter( 'the_author_posts_link', array( 'OCEANWP_Theme_Class', 'the_author_posts_link' ) ); // Add support for Elementor Pro locations. add_action( 'elementor/theme/register_locations', array( 'OCEANWP_Theme_Class', 'register_elementor_locations' ) ); // Remove the default lightbox script for the beaver builder plugin. add_filter( 'fl_builder_override_lightbox', array( 'OCEANWP_Theme_Class', 'remove_bb_lightbox' ) ); add_filter( 'ocean_enqueue_generated_files', '__return_false' ); } } /** * Migration Functinality * * @since 1.0.0 */ public static function migration() { if ( get_theme_mod( 'ocean_disable_emoji', false ) ) { set_theme_mod( 'ocean_performance_emoji', 'disabled' ); } if ( get_theme_mod( 'ocean_disable_lightbox', false ) ) { set_theme_mod( 'ocean_performance_lightbox', 'disabled' ); } } /** * Define Constants * * @since 1.0.0 */ public static function oceanwp_constants() { $version = self::theme_version(); // Theme version. define( 'OCEANWP_THEME_VERSION', $version ); // Javascript and CSS Paths. define( 'OCEANWP_JS_DIR_URI', OCEANWP_THEME_URI . '/assets/js/' ); define( 'OCEANWP_CSS_DIR_URI', OCEANWP_THEME_URI . '/assets/css/' ); // Include Paths. define( 'OCEANWP_INC_DIR', OCEANWP_THEME_DIR . '/inc/' ); define( 'OCEANWP_INC_DIR_URI', OCEANWP_THEME_URI . '/inc/' ); // Check if plugins are active. define( 'OCEAN_EXTRA_ACTIVE', class_exists( 'Ocean_Extra' ) ); define( 'OCEANWP_ELEMENTOR_ACTIVE', class_exists( 'Elementor\Plugin' ) ); define( 'OCEANWP_BEAVER_BUILDER_ACTIVE', class_exists( 'FLBuilder' ) ); define( 'OCEANWP_WOOCOMMERCE_ACTIVE', class_exists( 'WooCommerce' ) ); define( 'OCEANWP_EDD_ACTIVE', class_exists( 'Easy_Digital_Downloads' ) ); define( 'OCEANWP_LIFTERLMS_ACTIVE', class_exists( 'LifterLMS' ) ); define( 'OCEANWP_ALNP_ACTIVE', class_exists( 'Auto_Load_Next_Post' ) ); define( 'OCEANWP_LEARNDASH_ACTIVE', class_exists( 'SFWD_LMS' ) ); } /** * Load all core theme function files * * @since 1.0.0oceanwp_has_setup */ public static function oceanwp_has_setup() { $dir = OCEANWP_INC_DIR; require_once $dir . 'helpers.php'; require_once $dir . 'header-content.php'; require_once $dir . 'oceanwp-strings.php'; require_once $dir . 'oceanwp-svg.php'; require_once $dir . 'oceanwp-theme-icons.php'; require_once $dir . 'template-helpers.php'; require_once $dir . 'customizer/controls/typography/webfonts.php'; require_once $dir . 'walker/init.php'; require_once $dir . 'walker/menu-walker.php'; require_once $dir . 'third/class-gutenberg.php'; require_once $dir . 'third/class-elementor.php'; require_once $dir . 'third/class-beaver-themer.php'; require_once $dir . 'third/class-bbpress.php'; require_once $dir . 'third/class-buddypress.php'; require_once $dir . 'third/class-lifterlms.php'; require_once $dir . 'third/class-learndash.php'; require_once $dir . 'third/class-sensei.php'; require_once $dir . 'third/class-social-login.php'; require_once $dir . 'third/class-amp.php'; require_once $dir . 'third/class-pwa.php'; // WooCommerce. if ( OCEANWP_WOOCOMMERCE_ACTIVE ) { require_once $dir . 'woocommerce/woocommerce-config.php'; } // Easy Digital Downloads. if ( OCEANWP_EDD_ACTIVE ) { require_once $dir . 'edd/edd-config.php'; } } /** * Returns current theme version * * @since 1.0.0 */ public static function theme_version() { // Get theme data. $theme = wp_get_theme(); // Return theme version. return $theme->get( 'Version' ); } /** * Compare WordPress version * * @access public * @since 1.8.3 * @param string $version - A WordPress version to compare against current version. * @return boolean */ public static function is_wp_version( $version = '5.4' ) { global $wp_version; // WordPress version. return version_compare( strtolower( $wp_version ), strtolower( $version ), '>=' ); } /** * Check for AMP endpoint * * @return bool * @since 1.8.7 */ public static function oceanwp_is_amp() { return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint(); } /** * Load theme classes * * @since 1.0.0 */ public static function classes() { // Admin only classes. if ( is_admin() ) { // Recommend plugins. require_once OCEANWP_INC_DIR . 'activation-notice/class-oceanwp-plugin-manager.php'; require_once OCEANWP_INC_DIR . 'activation-notice/template.php'; // Ajax Actions if (defined('DOING_AJAX') && DOING_AJAX) { require OCEANWP_INC_DIR . 'activation-notice/api.php'; } // Front-end classes. } else { // Breadcrumbs class. require_once OCEANWP_INC_DIR . 'breadcrumbs.php'; } // Customizer class. require_once OCEANWP_INC_DIR . 'customizer/library/customizer-custom-controls/functions.php'; require_once OCEANWP_INC_DIR . 'customizer/customizer.php'; } /** * Theme Setup * * @since 1.0.0 */ public static function theme_setup() { // Load text domain. load_theme_textdomain( 'oceanwp', OCEANWP_THEME_DIR . '/languages' ); // Get globals. global $content_width; // Set content width based on theme's default design. if ( ! isset( $content_width ) ) { $content_width = 1200; } // Register navigation menus. register_nav_menus( array( 'topbar_menu' => esc_html__( 'Top Bar', 'oceanwp' ), 'main_menu' => esc_html__( 'Main', 'oceanwp' ), 'footer_menu' => esc_html__( 'Footer', 'oceanwp' ), 'mobile_menu' => esc_html__( 'Mobile (optional)', 'oceanwp' ), ) ); // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'video', 'gallery', 'audio', 'quote', 'link' ) ); // Enable support for tag. add_theme_support( 'title-tag' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Enable support for Post Thumbnails on posts and pages. add_theme_support( 'post-thumbnails' ); /** * Enable support for header image */ add_theme_support( 'custom-header', apply_filters( 'ocean_custom_header_args', array( 'width' => 2000, 'height' => 1200, 'flex-height' => true, 'video' => true, ) ) ); /** * Enable support for site logo */ add_theme_support( 'custom-logo', apply_filters( 'ocean_custom_logo_args', array( 'height' => 45, 'width' => 164, 'flex-height' => true, 'flex-width' => true, ) ) ); /* * Switch default core markup for search form, comment form, comments, galleries, captions and widgets * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', 'widgets', ) ); // Declare WooCommerce support. add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); // Add editor style. add_editor_style( 'assets/css/editor-style.min.css' ); // Declare support for selective refreshing of widgets. add_theme_support( 'customize-selective-refresh-widgets' ); } /** * Adds the meta tag to the site header * * @since 1.1.0 */ public static function pingback_header() { if ( is_singular() && pings_open() ) { printf( '<link rel="pingback" href="%s">' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); } } /** * Adds the meta tag to the site header * * @since 1.0.0 */ public static function meta_viewport() { // Meta viewport. $viewport = '<meta name="viewport" content="width=device-width, initial-scale=1">'; // Apply filters for child theme tweaking. echo apply_filters( 'ocean_meta_viewport', $viewport ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Load scripts in the WP admin * * @since 1.0.0 */ public static function admin_scripts() { global $pagenow; if ( 'nav-menus.php' === $pagenow ) { wp_enqueue_style( 'oceanwp-menus', OCEANWP_INC_DIR_URI . 'walker/assets/menus.css', false, OCEANWP_THEME_VERSION ); } } /** * Load front-end scripts * * @since 1.0.0 */ public static function theme_css() { // Define dir. $dir = OCEANWP_CSS_DIR_URI; $theme_version = OCEANWP_THEME_VERSION; // Remove font awesome style from plugins. wp_deregister_style( 'font-awesome' ); wp_deregister_style( 'fontawesome' ); // Enqueue font awesome style. if ( get_theme_mod( 'ocean_performance_fontawesome', 'enabled' ) === 'enabled' ) { wp_enqueue_style( 'font-awesome', OCEANWP_THEME_URI . '/assets/fonts/fontawesome/css/all.min.css', false, '5.15.1' ); } // Enqueue simple line icons style. if ( get_theme_mod( 'ocean_performance_simple_line_icons', 'enabled' ) === 'enabled' ) { wp_enqueue_style( 'simple-line-icons', $dir . 'third/simple-line-icons.min.css', false, '2.4.0' ); } // Enqueue Main style. wp_enqueue_style( 'oceanwp-style', $dir . 'style.min.css', false, $theme_version ); // Blog Header styles. if ( 'default' !== get_theme_mod( 'oceanwp_single_post_header_style', 'default' ) && is_single() && 'post' === get_post_type() ) { wp_enqueue_style( 'oceanwp-blog-headers', $dir . 'blog/blog-post-headers.css', false, $theme_version ); } // Register perfect-scrollbar plugin style. wp_register_style( 'ow-perfect-scrollbar', $dir . 'third/perfect-scrollbar.css', false, '1.5.0' ); // Register hamburgers buttons to easily use them. wp_register_style( 'oceanwp-hamburgers', $dir . 'third/hamburgers/hamburgers.min.css', false, $theme_version ); // Register hamburgers buttons styles. $hamburgers = oceanwp_hamburgers_styles(); foreach ( $hamburgers as $class => $name ) { wp_register_style( 'oceanwp-' . $class . '', $dir . 'third/hamburgers/types/' . $class . '.css', false, $theme_version ); } // Get mobile menu icon style. $mobile_menu = get_theme_mod( 'ocean_mobile_menu_open_hamburger', 'default' ); // Enqueue mobile menu icon style. if ( ! empty( $mobile_menu ) && 'default' !== $mobile_menu ) { wp_enqueue_style( 'oceanwp-hamburgers' ); wp_enqueue_style( 'oceanwp-' . $mobile_menu . '' ); } // If Vertical header style. if ( 'vertical' === oceanwp_header_style() ) { wp_enqueue_style( 'oceanwp-hamburgers' ); wp_enqueue_style( 'oceanwp-spin' ); wp_enqueue_style( 'ow-perfect-scrollbar' ); } } /** * Returns all js needed for the front-end * * @since 1.0.0 */ public static function theme_js() { if ( self::oceanwp_is_amp() ) { return; } // Get js directory uri. $dir = OCEANWP_JS_DIR_URI; // Get current theme version. $theme_version = OCEANWP_THEME_VERSION; // Get localized array. $localize_array = self::localize_array(); // Main script dependencies. $main_script_dependencies = array( 'jquery' ); // Comment reply. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Add images loaded. wp_enqueue_script( 'imagesloaded' ); /** * Load Venors Scripts. */ // Isotop. wp_register_script( 'ow-isotop', $dir . 'vendors/isotope.pkgd.min.js', array(), '3.0.6', true ); // Flickity. wp_register_script( 'ow-flickity', $dir . 'vendors/flickity.pkgd.min.js', array(), $theme_version, true ); // Magnific Popup. wp_register_script( 'ow-magnific-popup', $dir . 'vendors/magnific-popup.min.js', array( 'jquery' ), $theme_version, true ); // Sidr Mobile Menu. wp_register_script( 'ow-sidr', $dir . 'vendors/sidr.js', array(), $theme_version, true ); // Perfect Scrollbar. wp_register_script( 'ow-perfect-scrollbar', $dir . 'vendors/perfect-scrollbar.min.js', array(), $theme_version, true ); // Smooth Scroll. wp_register_script( 'ow-smoothscroll', $dir . 'vendors/smoothscroll.min.js', array(), $theme_version, false ); /** * Load Theme Scripts. */ // Theme script. wp_enqueue_script( 'oceanwp-main', $dir . 'theme.min.js', $main_script_dependencies, $theme_version, true ); wp_localize_script( 'oceanwp-main', 'oceanwpLocalize', $localize_array ); array_push( $main_script_dependencies, 'oceanwp-main' ); // Blog Masonry script. if ( 'masonry' === oceanwp_blog_grid_style() ) { array_push( $main_script_dependencies, 'ow-isotop' ); wp_enqueue_script( 'ow-isotop' ); wp_enqueue_script( 'oceanwp-blog-masonry', $dir . 'blog-masonry.min.js', $main_script_dependencies, $theme_version, true ); } // Menu script. switch ( oceanwp_header_style() ) { case 'full_screen': wp_enqueue_script( 'oceanwp-full-screen-menu', $dir . 'full-screen-menu.min.js', $main_script_dependencies, $theme_version, true ); break; case 'vertical': array_push( $main_script_dependencies, 'ow-perfect-scrollbar' ); wp_enqueue_script( 'ow-perfect-scrollbar' ); wp_enqueue_script( 'oceanwp-vertical-header', $dir . 'vertical-header.min.js', $main_script_dependencies, $theme_version, true ); break; } // Mobile Menu script. switch ( oceanwp_mobile_menu_style() ) { case 'dropdown': wp_enqueue_script( 'oceanwp-drop-down-mobile-menu', $dir . 'drop-down-mobile-menu.min.js', $main_script_dependencies, $theme_version, true ); break; case 'fullscreen': wp_enqueue_script( 'oceanwp-full-screen-mobile-menu', $dir . 'full-screen-mobile-menu.min.js', $main_script_dependencies, $theme_version, true ); break; case 'sidebar': array_push( $main_script_dependencies, 'ow-sidr' ); wp_enqueue_script( 'ow-sidr' ); wp_enqueue_script( 'oceanwp-sidebar-mobile-menu', $dir . 'sidebar-mobile-menu.min.js', $main_script_dependencies, $theme_version, true ); break; } // Search script. switch ( oceanwp_menu_search_style() ) { case 'drop_down': wp_enqueue_script( 'oceanwp-drop-down-search', $dir . 'drop-down-search.min.js', $main_script_dependencies, $theme_version, true ); break; case 'header_replace': wp_enqueue_script( 'oceanwp-header-replace-search', $dir . 'header-replace-search.min.js', $main_script_dependencies, $theme_version, true ); break; case 'overlay': wp_enqueue_script( 'oceanwp-overlay-search', $dir . 'overlay-search.min.js', $main_script_dependencies, $theme_version, true ); break; } // Mobile Search Icon Style. if ( oceanwp_mobile_menu_search_style() !== 'disabled' ) { wp_enqueue_script( 'oceanwp-mobile-search-icon', $dir . 'mobile-search-icon.min.js', $main_script_dependencies, $theme_version, true ); } // Equal Height Elements script. if ( oceanwp_blog_entry_equal_heights() ) { wp_enqueue_script( 'oceanwp-equal-height-elements', $dir . 'equal-height-elements.min.js', $main_script_dependencies, $theme_version, true ); } // Lightbox script. if ( oceanwp_gallery_is_lightbox_enabled() || get_theme_mod( 'ocean_performance_lightbox', 'enabled' ) === 'enabled' ) { array_push( $main_script_dependencies, 'ow-magnific-popup' ); wp_enqueue_script( 'ow-magnific-popup' ); wp_enqueue_script( 'oceanwp-lightbox', $dir . 'ow-lightbox.min.js', $main_script_dependencies, $theme_version, true ); } // Slider script. array_push( $main_script_dependencies, 'ow-flickity' ); wp_enqueue_script( 'ow-flickity' ); wp_enqueue_script( 'oceanwp-slider', $dir . 'ow-slider.min.js', $main_script_dependencies, $theme_version, true ); // Scroll Effect script. if ( get_theme_mod( 'ocean_performance_scroll_effect', 'enabled' ) === 'enabled' ) { wp_enqueue_script( 'oceanwp-scroll-effect', $dir . 'scroll-effect.min.js', $main_script_dependencies, $theme_version, true ); } // Scroll to Top script. if ( oceanwp_display_scroll_up_button() ) { wp_enqueue_script( 'oceanwp-scroll-top', $dir . 'scroll-top.min.js', $main_script_dependencies, $theme_version, true ); } // Custom Select script. if ( get_theme_mod( 'ocean_performance_custom_select', 'enabled' ) === 'enabled' ) { wp_enqueue_script( 'oceanwp-select', $dir . 'select.min.js', $main_script_dependencies, $theme_version, true ); } // Infinite Scroll script. if ( 'infinite_scroll' === get_theme_mod( 'ocean_blog_pagination_style', 'standard' ) || 'infinite_scroll' === get_theme_mod( 'ocean_woo_pagination_style', 'standard' ) ) { wp_enqueue_script( 'oceanwp-infinite-scroll', $dir . 'ow-infinite-scroll.min.js', $main_script_dependencies, $theme_version, true ); } // WooCommerce scripts. if ( OCEANWP_WOOCOMMERCE_ACTIVE && 'yes' !== get_theme_mod( 'ocean_woo_remove_custom_features', 'no' ) ) { wp_enqueue_script( 'oceanwp-woocommerce-custom-features', $dir . 'wp-plugins/woocommerce/woo-custom-features.min.js', array( 'jquery' ), $theme_version, true ); wp_localize_script( 'oceanwp-woocommerce-custom-features', 'oceanwpLocalize', $localize_array ); } // Register scripts for old addons. wp_register_script( 'nicescroll', $dir . 'vendors/support-old-oceanwp-addons/jquery.nicescroll.min.js', array( 'jquery' ), $theme_version, true ); } /** * Functions.js localize array * * @since 1.0.0 */ public static function localize_array() { // Create array. $sidr_side = get_theme_mod( 'ocean_mobile_menu_sidr_direction', 'left' ); $sidr_side = $sidr_side ? $sidr_side : 'left'; $sidr_target = get_theme_mod( 'ocean_mobile_menu_sidr_dropdown_target', 'link' ); $sidr_target = $sidr_target ? $sidr_target : 'link'; $vh_target = get_theme_mod( 'ocean_vertical_header_dropdown_target', 'link' ); $vh_target = $vh_target ? $vh_target : 'link'; $scroll_offset = get_theme_mod( 'ocean_scroll_effect_offset_value' ); $scroll_offset = $scroll_offset ? $scroll_offset : 0; $array = array( 'nonce' => wp_create_nonce( 'oceanwp' ), 'isRTL' => is_rtl(), 'menuSearchStyle' => oceanwp_menu_search_style(), 'mobileMenuSearchStyle' => oceanwp_mobile_menu_search_style(), 'sidrSource' => oceanwp_sidr_menu_source(), 'sidrDisplace' => get_theme_mod( 'ocean_mobile_menu_sidr_displace', true ) ? true : false, 'sidrSide' => $sidr_side, 'sidrDropdownTarget' => $sidr_target, 'verticalHeaderTarget' => $vh_target, 'customScrollOffset' => $scroll_offset, 'customSelects' => '.woocommerce-ordering .orderby, #dropdown_product_cat, .widget_categories select, .widget_archive select, .single-product .variations_form .variations select', ); // WooCart. if ( OCEANWP_WOOCOMMERCE_ACTIVE ) { $array['wooCartStyle'] = oceanwp_menu_cart_style(); } // Apply filters and return array. return apply_filters( 'ocean_localize_array', $array ); } /** * Add headers for IE to override IE's Compatibility View Settings * * @param obj $headers header settings. * @since 1.0.0 */ public static function x_ua_compatible_headers( $headers ) { $headers['X-UA-Compatible'] = 'IE=edge'; return $headers; } /** * Registers sidebars * * @since 1.0.0 */ public static function register_sidebars() { $heading = get_theme_mod( 'ocean_sidebar_widget_heading_tag', 'h4' ); $heading = apply_filters( 'ocean_sidebar_widget_heading_tag', $heading ); $foo_heading = get_theme_mod( 'ocean_footer_widget_heading_tag', 'h4' ); $foo_heading = apply_filters( 'ocean_footer_widget_heading_tag', $foo_heading ); // Default Sidebar. register_sidebar( array( 'name' => esc_html__( 'Default Sidebar', 'oceanwp' ), 'id' => 'sidebar', 'description' => esc_html__( 'Widgets in this area will be displayed in the left or right sidebar area if you choose the Left or Right Sidebar layout.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="sidebar-box %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $heading . ' class="widget-title">', 'after_title' => '</' . $heading . '>', ) ); // Left Sidebar. register_sidebar( array( 'name' => esc_html__( 'Left Sidebar', 'oceanwp' ), 'id' => 'sidebar-2', 'description' => esc_html__( 'Widgets in this area are used in the left sidebar region if you use the Both Sidebars layout.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="sidebar-box %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $heading . ' class="widget-title">', 'after_title' => '</' . $heading . '>', ) ); // Search Results Sidebar. if ( get_theme_mod( 'ocean_search_custom_sidebar', true ) ) { register_sidebar( array( 'name' => esc_html__( 'Search Results Sidebar', 'oceanwp' ), 'id' => 'search_sidebar', 'description' => esc_html__( 'Widgets in this area are used in the search result page.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="sidebar-box %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $heading . ' class="widget-title">', 'after_title' => '</' . $heading . '>', ) ); } // Footer 1. register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'oceanwp' ), 'id' => 'footer-one', 'description' => esc_html__( 'Widgets in this area are used in the first footer region.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="footer-widget %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $foo_heading . ' class="widget-title">', 'after_title' => '</' . $foo_heading . '>', ) ); // Footer 2. register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'oceanwp' ), 'id' => 'footer-two', 'description' => esc_html__( 'Widgets in this area are used in the second footer region.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="footer-widget %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $foo_heading . ' class="widget-title">', 'after_title' => '</' . $foo_heading . '>', ) ); // Footer 3. register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'oceanwp' ), 'id' => 'footer-three', 'description' => esc_html__( 'Widgets in this area are used in the third footer region.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="footer-widget %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $foo_heading . ' class="widget-title">', 'after_title' => '</' . $foo_heading . '>', ) ); // Footer 4. register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'oceanwp' ), 'id' => 'footer-four', 'description' => esc_html__( 'Widgets in this area are used in the fourth footer region.', 'oceanwp' ), 'before_widget' => '<div id="%1$s" class="footer-widget %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<' . $foo_heading . ' class="widget-title">', 'after_title' => '</' . $foo_heading . '>', ) ); } /** * Registers theme_mod strings into Polylang. * * @since 1.1.4 */ public static function polylang_register_string() { if ( function_exists( 'pll_register_string' ) && $strings = oceanwp_register_tm_strings() ) { foreach ( $strings as $string => $default ) { pll_register_string( $string, get_theme_mod( $string, $default ), 'Theme Mod', true ); } } } /** * All theme functions hook into the oceanwp_head_css filter for this function. * * @param obj $output output value. * @since 1.0.0 */ public static function custom_css( $output = null ) { // Add filter for adding custom css via other functions. $output = apply_filters( 'ocean_head_css', $output ); // If Custom File is selected. if ( 'file' === get_theme_mod( 'ocean_customzer_styling', 'head' ) ) { global $wp_customize; $upload_dir = wp_upload_dir(); // Render CSS in the head. if ( isset( $wp_customize ) || ! file_exists( $upload_dir['basedir'] . '/oceanwp/custom-style.css' ) ) { // Minify and output CSS in the wp_head. if ( ! empty( $output ) ) { echo "<!-- OceanWP CSS -->\n<style type=\"text/css\">\n" . wp_strip_all_tags( oceanwp_minify_css( $output ) ) . "\n</style>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } else { // Minify and output CSS in the wp_head. if ( ! empty( $output ) ) { echo "<!-- OceanWP CSS -->\n<style type=\"text/css\">\n" . wp_strip_all_tags( oceanwp_minify_css( $output ) ) . "\n</style>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } /** * Minify the WP custom CSS because WordPress doesn't do it by default. * * @param obj $css minify css. * @since 1.1.9 */ public static function minify_custom_css( $css ) { return oceanwp_minify_css( $css ); } /** * Include Custom CSS file if present. * * @param obj $output output value. * @since 1.4.12 */ public static function custom_style_css( $output = null ) { // If Custom File is not selected. if ( 'file' !== get_theme_mod( 'ocean_customzer_styling', 'head' ) ) { return; } global $wp_customize; $upload_dir = wp_upload_dir(); // Get all the customier css. $output = apply_filters( 'ocean_head_css', $output ); // Get Custom Panel CSS. $output_custom_css = wp_get_custom_css(); // Minified the Custom CSS. $output .= oceanwp_minify_css( $output_custom_css ); // Render CSS from the custom file. if ( ! isset( $wp_customize ) && file_exists( $upload_dir['basedir'] . '/oceanwp/custom-style.css' ) && ! empty( $output ) ) { wp_enqueue_style( 'oceanwp-custom', trailingslashit( $upload_dir['baseurl'] ) . 'oceanwp/custom-style.css', false, false ); } } /** * Remove Customizer style script from front-end * * @since 1.4.12 */ public static function remove_customizer_custom_css() { // If Custom File is not selected. if ( 'file' !== get_theme_mod( 'ocean_customzer_styling', 'head' ) ) { return; } global $wp_customize; // Disable Custom CSS in the frontend head. remove_action( 'wp_head', 'wp_custom_css_cb', 11 ); remove_action( 'wp_head', 'wp_custom_css_cb', 101 ); // If custom CSS file exists and NOT in customizer screen. if ( isset( $wp_customize ) ) { add_action( 'wp_footer', 'wp_custom_css_cb', 9999 ); } } /** * Adds inline CSS for the admin * * @since 1.0.0 */ public static function admin_inline_css() { echo '<style>div#setting-error-tgmpa{display:block;}</style>'; } /** * Alter the search posts per page * * @param obj $query query. * @since 1.3.7 */ public static function search_posts_per_page( $query ) { $posts_per_page = get_theme_mod( 'ocean_search_post_per_page', '8' ); $posts_per_page = $posts_per_page ? $posts_per_page : '8'; if ( $query->is_main_query() && is_search() ) { $query->set( 'posts_per_page', $posts_per_page ); } } /** * Alter wp list categories arguments. * Adds a span around the counter for easier styling. * * @param obj $links link. * @since 1.0.0 */ public static function wp_list_categories_args( $links ) { $links = str_replace( '</a> (', '</a> <span class="cat-count-span">(', $links ); $links = str_replace( ')', ')</span>', $links ); return $links; } /** * Alters the default oembed output. * Adds special classes for responsive oembeds via CSS. * * @param obj $cache cache. * @param url $url url. * @param obj $attr attributes. * @param obj $post_ID post id. * @since 1.0.0 */ public static function add_responsive_wrap_to_oembeds( $cache, $url, $attr, $post_ID ) { // Supported video embeds. $hosts = apply_filters( 'ocean_oembed_responsive_hosts', array( 'vimeo.com', 'youtube.com', 'youtu.be', 'blip.tv', 'money.cnn.com', 'dailymotion.com', 'flickr.com', 'hulu.com', 'kickstarter.com', 'vine.co', 'soundcloud.com', '#http://((m|www)\.)?youtube\.com/watch.*#i', '#https://((m|www)\.)?youtube\.com/watch.*#i', '#http://((m|www)\.)?youtube\.com/playlist.*#i', '#https://((m|www)\.)?youtube\.com/playlist.*#i', '#http://youtu\.be/.*#i', '#https://youtu\.be/.*#i', '#https?://(.+\.)?vimeo\.com/.*#i', '#https?://(www\.)?dailymotion\.com/.*#i', '#https?://dai\.ly/*#i', '#https?://(www\.)?hulu\.com/watch/.*#i', '#https?://wordpress\.tv/.*#i', '#https?://(www\.)?funnyordie\.com/videos/.*#i', '#https?://vine\.co/v/.*#i', '#https?://(www\.)?collegehumor\.com/video/.*#i', '#https?://(www\.|embed\.)?ted\.com/talks/.*#i', ) ); // Supports responsive. $supports_responsive = false; // Check if responsive wrap should be added. foreach ( $hosts as $host ) { if ( strpos( $url, $host ) !== false ) { $supports_responsive = true; break; // no need to loop further. } } // Output code. if ( $supports_responsive ) { return '<p class="responsive-video-wrap clr">' . $cache . '</p>'; } else { return '<div class="oceanwp-oembed-wrap clr">' . $cache . '</div>'; } } /** * Adds extra classes to the post_class() output * * @param obj $classes Return classes. * @since 1.0.0 */ public static function post_class( $classes ) { // Get post. global $post; // Add entry class. $classes[] = 'entry'; // Add has media class. if ( has_post_thumbnail() || get_post_meta( $post->ID, 'ocean_post_oembed', true ) || get_post_meta( $post->ID, 'ocean_post_self_hosted_media', true ) || get_post_meta( $post->ID, 'ocean_post_video_embed', true ) ) { $classes[] = 'has-media'; } // Return classes. return $classes; } /** * Add schema markup to the authors post link * * @param obj $link Author link. * @since 1.0.0 */ public static function the_author_posts_link( $link ) { // Add schema markup. $schema = oceanwp_get_schema_markup( 'author_link' ); if ( $schema ) { $link = str_replace( 'rel="author"', 'rel="author" ' . $schema, $link ); } // Return link. return $link; } /** * Add support for Elementor Pro locations * * @param obj $elementor_theme_manager Elementor Instance. * @since 1.5.6 */ public static function register_elementor_locations( $elementor_theme_manager ) { $elementor_theme_manager->register_all_core_location(); } /** * Add schema markup to the authors post link * * @since 1.1.5 */ public static function remove_bb_lightbox() { return true; } } /**-------------------------------------------------------------------------------- #region Freemius - This logic will only be executed when Ocean Extra is active and has the Freemius SDK ---------------------------------------------------------------------------------*/ if ( ! function_exists( 'owp_fs' ) ) { if ( class_exists( 'Ocean_Extra' ) && defined( 'OE_FILE_PATH' ) && file_exists( dirname( OE_FILE_PATH ) . '/includes/freemius/start.php' ) ) { /** * Create a helper function for easy SDK access. */ function owp_fs() { global $owp_fs; if ( ! isset( $owp_fs ) ) { // Include Freemius SDK. require_once dirname( OE_FILE_PATH ) . '/includes/freemius/start.php'; $owp_fs = fs_dynamic_init( array( 'id' => '3752', 'bundle_id' => '3767', 'slug' => 'oceanwp', 'type' => 'theme', 'public_key' => 'pk_043077b34f20f5e11334af3c12493', 'bundle_public_key' => 'pk_c334eb1ae413deac41e30bf00b9dc', 'is_premium' => false, 'has_addons' => true, 'has_paid_plans' => true, 'menu' => array( 'slug' => 'oceanwp', 'account' => true, 'contact' => false, 'support' => false, ), 'bundle_license_auto_activation' => true, 'navigation' => 'menu', 'is_org_compliant' => true, ) ); } return $owp_fs; } // Init Freemius. owp_fs(); // Signal that SDK was initiated. do_action( 'owp_fs_loaded' ); } } // endregion new OCEANWP_Theme_Class(); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������home/eticmes/www/wp-content/themes/goya-child/functions.php�����������������������������������������0000644�����������������00000000645�15154671215�0020111 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Theme functions and definitions. */ function goya_child_enqueue_styles() { wp_enqueue_style( 'goya-style' , get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'goya-child-style', get_stylesheet_directory_uri() . '/style.css', array( 'goya-style' ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'goya_child_enqueue_styles' );�������������������������������������������������������������������������������������������home/eticmes/www/wp-content/themes/twentytwentyfour/functions.php�����������������������������������0000644�����������������00000012556�15155121165�0021571 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Twenty Twenty-Four functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package Twenty Twenty-Four * @since Twenty Twenty-Four 1.0 */ /** * Register block styles. */ if ( ! function_exists( 'twentytwentyfour_block_styles' ) ) : /** * Register custom block styles * * @since Twenty Twenty-Four 1.0 * @return void */ function twentytwentyfour_block_styles() { register_block_style( 'core/details', array( 'name' => 'arrow-icon-details', 'label' => __( 'Arrow icon', 'twentytwentyfour' ), /* * Styles for the custom Arrow icon style of the Details block */ 'inline_style' => ' .is-style-arrow-icon-details { padding-top: var(--wp--preset--spacing--10); padding-bottom: var(--wp--preset--spacing--10); } .is-style-arrow-icon-details summary { list-style-type: "\2193\00a0\00a0\00a0"; } .is-style-arrow-icon-details[open]>summary { list-style-type: "\2192\00a0\00a0\00a0"; }', ) ); register_block_style( 'core/post-terms', array( 'name' => 'pill', 'label' => __( 'Pill', 'twentytwentyfour' ), /* * Styles variation for post terms * https://github.com/WordPress/gutenberg/issues/24956 */ 'inline_style' => ' .is-style-pill a, .is-style-pill span:not([class], [data-rich-text-placeholder]) { display: inline-block; background-color: var(--wp--preset--color--base-2); padding: 0.375rem 0.875rem; border-radius: var(--wp--preset--spacing--20); } .is-style-pill a:hover { background-color: var(--wp--preset--color--contrast-3); }', ) ); register_block_style( 'core/list', array( 'name' => 'checkmark-list', 'label' => __( 'Checkmark', 'twentytwentyfour' ), /* * Styles for the custom checkmark list block style * https://github.com/WordPress/gutenberg/issues/51480 */ 'inline_style' => ' ul.is-style-checkmark-list { list-style-type: "\2713"; } ul.is-style-checkmark-list li { padding-inline-start: 1ch; }', ) ); register_block_style( 'core/navigation-link', array( 'name' => 'arrow-link', 'label' => __( 'With arrow', 'twentytwentyfour' ), /* * Styles for the custom arrow nav link block style */ 'inline_style' => ' .is-style-arrow-link .wp-block-navigation-item__label:after { content: "\2197"; padding-inline-start: 0.25rem; vertical-align: middle; text-decoration: none; display: inline-block; }', ) ); register_block_style( 'core/heading', array( 'name' => 'asterisk', 'label' => __( 'With asterisk', 'twentytwentyfour' ), 'inline_style' => " .is-style-asterisk:before { content: ''; width: 1.5rem; height: 3rem; background: var(--wp--preset--color--contrast-2, currentColor); clip-path: path('M11.93.684v8.039l5.633-5.633 1.216 1.23-5.66 5.66h8.04v1.737H13.2l5.701 5.701-1.23 1.23-5.742-5.742V21h-1.737v-8.094l-5.77 5.77-1.23-1.217 5.743-5.742H.842V9.98h8.162l-5.701-5.7 1.23-1.231 5.66 5.66V.684h1.737Z'); display: block; } /* Hide the asterisk if the heading has no content, to avoid using empty headings to display the asterisk only, which is an A11Y issue */ .is-style-asterisk:empty:before { content: none; } .is-style-asterisk:-moz-only-whitespace:before { content: none; } .is-style-asterisk.has-text-align-center:before { margin: 0 auto; } .is-style-asterisk.has-text-align-right:before { margin-left: auto; } .rtl .is-style-asterisk.has-text-align-left:before { margin-right: auto; }", ) ); } endif; add_action( 'init', 'twentytwentyfour_block_styles' ); /** * Enqueue block stylesheets. */ if ( ! function_exists( 'twentytwentyfour_block_stylesheets' ) ) : /** * Enqueue custom block stylesheets * * @since Twenty Twenty-Four 1.0 * @return void */ function twentytwentyfour_block_stylesheets() { /** * The wp_enqueue_block_style() function allows us to enqueue a stylesheet * for a specific block. These will only get loaded when the block is rendered * (both in the editor and on the front end), improving performance * and reducing the amount of data requested by visitors. * * See https://make.wordpress.org/core/2021/12/15/using-multiple-stylesheets-per-block/ for more info. */ wp_enqueue_block_style( 'core/button', array( 'handle' => 'twentytwentyfour-button-style-outline', 'src' => get_parent_theme_file_uri( 'assets/css/button-outline.css' ), 'ver' => wp_get_theme( get_template() )->get( 'Version' ), 'path' => get_parent_theme_file_path( 'assets/css/button-outline.css' ), ) ); } endif; add_action( 'init', 'twentytwentyfour_block_stylesheets' ); /** * Register pattern categories. */ if ( ! function_exists( 'twentytwentyfour_pattern_categories' ) ) : /** * Register pattern categories * * @since Twenty Twenty-Four 1.0 * @return void */ function twentytwentyfour_pattern_categories() { register_block_pattern_category( 'page', array( 'label' => _x( 'Pages', 'Block pattern category' ), 'description' => __( 'A collection of full page layouts.' ), ) ); } endif; add_action( 'init', 'twentytwentyfour_pattern_categories' ); ��������������������������������������������������������������������������������������������������������������������������������������������������home/eticmes/www/wp-content/themes/twentytwentytwo/functions.php������������������������������������0000644�����������������00000002571�15155136363�0021431 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Twenty Twenty-Two functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Twenty_Two * @since Twenty Twenty-Two 1.0 */ if ( ! function_exists( 'twentytwentytwo_support' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * @since Twenty Twenty-Two 1.0 * * @return void */ function twentytwentytwo_support() { // Add support for block styles. add_theme_support( 'wp-block-styles' ); // Enqueue editor styles. add_editor_style( 'style.css' ); } endif; add_action( 'after_setup_theme', 'twentytwentytwo_support' ); if ( ! function_exists( 'twentytwentytwo_styles' ) ) : /** * Enqueue styles. * * @since Twenty Twenty-Two 1.0 * * @return void */ function twentytwentytwo_styles() { // Register theme stylesheet. $theme_version = wp_get_theme()->get( 'Version' ); $version_string = is_string( $theme_version ) ? $theme_version : false; wp_register_style( 'twentytwentytwo-style', get_template_directory_uri() . '/style.css', array(), $version_string ); // Enqueue theme stylesheet. wp_enqueue_style( 'twentytwentytwo-style' ); } endif; add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' ); // Add block patterns require get_template_directory() . '/inc/block-patterns.php'; ���������������������������������������������������������������������������������������������������������������������������������������home/eticmes/www/wp-content/themes/goya/functions.php�����������������������������������������������0000644�����������������00000003774�15155174615�0017041 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Goya functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package Goya */ // Constants: Folder directories/uri's define( 'GOYA_THEME_DIR', get_template_directory() ); define( 'GOYA_DIR', get_template_directory() . '/inc' ); define( 'GOYA_THEME_URI', get_template_directory_uri() ); define( 'GOYA_URI', get_template_directory_uri() . '/inc' ); // Constant: Framework namespace define( 'GOYA_NAMESPACE', 'goya' ); // Constant: Theme version define( 'GOYA_THEME_VERSION', '1.0.8.2' ); // Theme setup if (! apply_filters('goya_disable_setup_wizard', false) == true) { // TGM Plugin Activation Class require GOYA_DIR .'/admin/plugins/plugins.php'; // Imports require GOYA_DIR .'/admin/imports/import.php'; // Theme Wizard require_once get_parent_theme_file_path( '/inc/merlin/vendor/autoload.php' ); require_once get_parent_theme_file_path( '/inc/merlin/class-merlin.php' ); require_once get_parent_theme_file_path( '/inc/admin/setup/merlin-config.php' ); require_once get_parent_theme_file_path( '/inc/admin/setup/merlin-filters.php' ); } // Frontend Functions require GOYA_DIR .'/misc.php'; require GOYA_DIR .'/frontend/header.php'; require GOYA_DIR .'/frontend/footer.php'; require GOYA_DIR .'/frontend/panels.php'; require GOYA_DIR .'/frontend/entry.php'; // Script Calls require GOYA_DIR .'/script-calls.php'; // Ajax require GOYA_DIR .'/ajax.php'; // Add Menu Support require GOYA_DIR .'/mega-menu.php'; // Enable Sidebars require GOYA_DIR .'/sidebar.php'; // Language/Currency switchers require GOYA_DIR .'/switchers.php'; // WooCommerce related functions require GOYA_DIR .'/woocommerce/wc-functions.php'; require GOYA_DIR .'/woocommerce/wc-elements.php'; require GOYA_DIR .'/woocommerce/category-image.php'; // Gutenberg related functions require GOYA_DIR .'/gutenberg.php'; // CSS Output of Theme Options require GOYA_DIR .'/custom-styles.php'; // Kirki: Load Config options require GOYA_DIR .'/admin/settings/kirki.config.php'; ����home/eticmes/www/wp-content/themes/twentytwentyfive/functions.php�����������������������������������0000644�����������������00000010236�15155444301�0021540 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Twenty Twenty-Five functions and definitions. * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Twenty_Five * @since Twenty Twenty-Five 1.0 */ // Adds theme support for post formats. if ( ! function_exists( 'twentytwentyfive_post_format_setup' ) ) : /** * Adds theme support for post formats. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_post_format_setup() { add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); } endif; add_action( 'after_setup_theme', 'twentytwentyfive_post_format_setup' ); // Enqueues editor-style.css in the editors. if ( ! function_exists( 'twentytwentyfive_editor_style' ) ) : /** * Enqueues editor-style.css in the editors. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_editor_style() { add_editor_style( get_parent_theme_file_uri( 'assets/css/editor-style.css' ) ); } endif; add_action( 'after_setup_theme', 'twentytwentyfive_editor_style' ); // Enqueues style.css on the front. if ( ! function_exists( 'twentytwentyfive_enqueue_styles' ) ) : /** * Enqueues style.css on the front. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_enqueue_styles() { wp_enqueue_style( 'twentytwentyfive-style', get_parent_theme_file_uri( 'style.css' ), array(), wp_get_theme()->get( 'Version' ) ); } endif; add_action( 'wp_enqueue_scripts', 'twentytwentyfive_enqueue_styles' ); // Registers custom block styles. if ( ! function_exists( 'twentytwentyfive_block_styles' ) ) : /** * Registers custom block styles. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_block_styles() { register_block_style( 'core/list', array( 'name' => 'checkmark-list', 'label' => __( 'Checkmark', 'twentytwentyfive' ), 'inline_style' => ' ul.is-style-checkmark-list { list-style-type: "\2713"; } ul.is-style-checkmark-list li { padding-inline-start: 1ch; }', ) ); } endif; add_action( 'init', 'twentytwentyfive_block_styles' ); // Registers pattern categories. if ( ! function_exists( 'twentytwentyfive_pattern_categories' ) ) : /** * Registers pattern categories. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_pattern_categories() { register_block_pattern_category( 'twentytwentyfive_page', array( 'label' => __( 'Pages', 'twentytwentyfive' ), 'description' => __( 'A collection of full page layouts.', 'twentytwentyfive' ), ) ); register_block_pattern_category( 'twentytwentyfive_post-format', array( 'label' => __( 'Post formats', 'twentytwentyfive' ), 'description' => __( 'A collection of post format patterns.', 'twentytwentyfive' ), ) ); } endif; add_action( 'init', 'twentytwentyfive_pattern_categories' ); // Registers block binding sources. if ( ! function_exists( 'twentytwentyfive_register_block_bindings' ) ) : /** * Registers the post format block binding source. * * @since Twenty Twenty-Five 1.0 * * @return void */ function twentytwentyfive_register_block_bindings() { register_block_bindings_source( 'twentytwentyfive/format', array( 'label' => _x( 'Post format name', 'Label for the block binding placeholder in the editor', 'twentytwentyfive' ), 'get_value_callback' => 'twentytwentyfive_format_binding', ) ); } endif; add_action( 'init', 'twentytwentyfive_register_block_bindings' ); // Registers block binding callback function for the post format name. if ( ! function_exists( 'twentytwentyfive_format_binding' ) ) : /** * Callback function for the post format name block binding source. * * @since Twenty Twenty-Five 1.0 * * @return string|void Post format name, or nothing if the format is 'standard'. */ function twentytwentyfive_format_binding() { $post_format_slug = get_post_format(); if ( $post_format_slug && 'standard' !== $post_format_slug ) { return get_post_format_string( $post_format_slug ); } } endif; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������home/eticmes/www/wp-content/themes/twentytwentyone/functions.php������������������������������������0000644�����������������00000045541�15155450632�0021403 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since Twenty Twenty-One 1.0 */ // This theme requires WordPress 5.3 or later. if ( version_compare( $GLOBALS['wp_version'], '5.3', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; } if ( ! function_exists( 'twenty_twenty_one_setup' ) ) { /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_setup() { // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * This theme does not use a hard-coded <title> tag in the document head, * WordPress will provide it for us. */ add_theme_support( 'title-tag' ); /** * Add post-formats support. */ add_theme_support( 'post-formats', array( 'link', 'aside', 'gallery', 'image', 'quote', 'status', 'video', 'audio', 'chat', ) ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1568, 9999 ); register_nav_menus( array( 'primary' => esc_html__( 'Primary menu', 'twentytwentyone' ), 'footer' => esc_html__( 'Secondary menu', 'twentytwentyone' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', 'navigation-widgets', ) ); /* * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ $logo_width = 300; $logo_height = 100; add_theme_support( 'custom-logo', array( 'height' => $logo_height, 'width' => $logo_width, 'flex-width' => true, 'flex-height' => true, 'unlink-homepage-logo' => true, ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); $background_color = get_theme_mod( 'background_color', 'D1E4DD' ); if ( 127 > Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( $background_color ) ) { add_theme_support( 'dark-editor-style' ); } $editor_stylesheet_path = './assets/css/style-editor.css'; // Note, the is_IE global variable is defined by WordPress and is used // to detect if the current browser is internet explorer. global $is_IE; if ( $is_IE ) { $editor_stylesheet_path = './assets/css/ie-editor.css'; } // Enqueue editor styles. add_editor_style( $editor_stylesheet_path ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Extra small', 'twentytwentyone' ), 'shortName' => esc_html_x( 'XS', 'Font size', 'twentytwentyone' ), 'size' => 16, 'slug' => 'extra-small', ), array( 'name' => esc_html__( 'Small', 'twentytwentyone' ), 'shortName' => esc_html_x( 'S', 'Font size', 'twentytwentyone' ), 'size' => 18, 'slug' => 'small', ), array( 'name' => esc_html__( 'Normal', 'twentytwentyone' ), 'shortName' => esc_html_x( 'M', 'Font size', 'twentytwentyone' ), 'size' => 20, 'slug' => 'normal', ), array( 'name' => esc_html__( 'Large', 'twentytwentyone' ), 'shortName' => esc_html_x( 'L', 'Font size', 'twentytwentyone' ), 'size' => 24, 'slug' => 'large', ), array( 'name' => esc_html__( 'Extra large', 'twentytwentyone' ), 'shortName' => esc_html_x( 'XL', 'Font size', 'twentytwentyone' ), 'size' => 40, 'slug' => 'extra-large', ), array( 'name' => esc_html__( 'Huge', 'twentytwentyone' ), 'shortName' => esc_html_x( 'XXL', 'Font size', 'twentytwentyone' ), 'size' => 96, 'slug' => 'huge', ), array( 'name' => esc_html__( 'Gigantic', 'twentytwentyone' ), 'shortName' => esc_html_x( 'XXXL', 'Font size', 'twentytwentyone' ), 'size' => 144, 'slug' => 'gigantic', ), ) ); // Custom background color. add_theme_support( 'custom-background', array( 'default-color' => 'd1e4dd', ) ); // Editor color palette. $black = '#000000'; $dark_gray = '#28303D'; $gray = '#39414D'; $green = '#D1E4DD'; $blue = '#D1DFE4'; $purple = '#D1D1E4'; $red = '#E4D1D1'; $orange = '#E4DAD1'; $yellow = '#EEEADD'; $white = '#FFFFFF'; add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Black', 'twentytwentyone' ), 'slug' => 'black', 'color' => $black, ), array( 'name' => esc_html__( 'Dark gray', 'twentytwentyone' ), 'slug' => 'dark-gray', 'color' => $dark_gray, ), array( 'name' => esc_html__( 'Gray', 'twentytwentyone' ), 'slug' => 'gray', 'color' => $gray, ), array( 'name' => esc_html__( 'Green', 'twentytwentyone' ), 'slug' => 'green', 'color' => $green, ), array( 'name' => esc_html__( 'Blue', 'twentytwentyone' ), 'slug' => 'blue', 'color' => $blue, ), array( 'name' => esc_html__( 'Purple', 'twentytwentyone' ), 'slug' => 'purple', 'color' => $purple, ), array( 'name' => esc_html__( 'Red', 'twentytwentyone' ), 'slug' => 'red', 'color' => $red, ), array( 'name' => esc_html__( 'Orange', 'twentytwentyone' ), 'slug' => 'orange', 'color' => $orange, ), array( 'name' => esc_html__( 'Yellow', 'twentytwentyone' ), 'slug' => 'yellow', 'color' => $yellow, ), array( 'name' => esc_html__( 'White', 'twentytwentyone' ), 'slug' => 'white', 'color' => $white, ), ) ); add_theme_support( 'editor-gradient-presets', array( array( 'name' => esc_html__( 'Purple to yellow', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'purple-to-yellow', ), array( 'name' => esc_html__( 'Yellow to purple', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $purple . ' 100%)', 'slug' => 'yellow-to-purple', ), array( 'name' => esc_html__( 'Green to yellow', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'green-to-yellow', ), array( 'name' => esc_html__( 'Yellow to green', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $green . ' 100%)', 'slug' => 'yellow-to-green', ), array( 'name' => esc_html__( 'Red to yellow', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $yellow . ' 100%)', 'slug' => 'red-to-yellow', ), array( 'name' => esc_html__( 'Yellow to red', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $red . ' 100%)', 'slug' => 'yellow-to-red', ), array( 'name' => esc_html__( 'Purple to red', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $red . ' 100%)', 'slug' => 'purple-to-red', ), array( 'name' => esc_html__( 'Red to purple', 'twentytwentyone' ), 'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $purple . ' 100%)', 'slug' => 'red-to-purple', ), ) ); /* * Adds starter content to highlight the theme on fresh sites. * This is done conditionally to avoid loading the starter content on every * page load, as it is a one-off operation only needed once in the customizer. */ if ( is_customize_preview() ) { require get_template_directory() . '/inc/starter-content.php'; add_theme_support( 'starter-content', twenty_twenty_one_get_starter_content() ); } // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); // Add support for custom line height controls. add_theme_support( 'custom-line-height' ); // Add support for link color control. add_theme_support( 'link-color' ); // Add support for experimental cover block spacing. add_theme_support( 'custom-spacing' ); // Add support for custom units. // This was removed in WordPress 5.6 but is still required to properly support WP 5.5. add_theme_support( 'custom-units' ); // Remove feed icon link from legacy RSS widget. add_filter( 'rss_widget_feed_link', '__return_empty_string' ); } } add_action( 'after_setup_theme', 'twenty_twenty_one_setup' ); /** * Registers widget area. * * @since Twenty Twenty-One 1.0 * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar * * @return void */ function twenty_twenty_one_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Footer', 'twentytwentyone' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here to appear in your footer.', 'twentytwentyone' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'twenty_twenty_one_widgets_init' ); /** * Sets the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @since Twenty Twenty-One 1.0 * * @global int $content_width Content width. * * @return void */ function twenty_twenty_one_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters( 'twenty_twenty_one_content_width', 750 ); } add_action( 'after_setup_theme', 'twenty_twenty_one_content_width', 0 ); /** * Enqueues scripts and styles. * * @since Twenty Twenty-One 1.0 * * @global bool $is_IE * @global WP_Scripts $wp_scripts * * @return void */ function twenty_twenty_one_scripts() { // Note, the is_IE global variable is defined by WordPress and is used // to detect if the current browser is internet explorer. global $is_IE, $wp_scripts; if ( $is_IE ) { // If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables. wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) ); } else { // If not IE, use the standard stylesheet. wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) ); } // RTL styles. wp_style_add_data( 'twenty-twenty-one-style', 'rtl', 'replace' ); // Print styles. wp_enqueue_style( 'twenty-twenty-one-print-style', get_template_directory_uri() . '/assets/css/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' ); // Threaded comment reply styles. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Register the IE11 polyfill file. wp_register_script( 'twenty-twenty-one-ie11-polyfills-asset', get_template_directory_uri() . '/assets/js/polyfills.js', array(), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); // Register the IE11 polyfill loader. wp_register_script( 'twenty-twenty-one-ie11-polyfills', null, array(), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); wp_add_inline_script( 'twenty-twenty-one-ie11-polyfills', wp_get_script_polyfill( $wp_scripts, array( 'Element.prototype.matches && Element.prototype.closest && window.NodeList && NodeList.prototype.forEach' => 'twenty-twenty-one-ie11-polyfills-asset', ) ) ); // Main navigation scripts. if ( has_nav_menu( 'primary' ) ) { wp_enqueue_script( 'twenty-twenty-one-primary-navigation-script', get_template_directory_uri() . '/assets/js/primary-navigation.js', array( 'twenty-twenty-one-ie11-polyfills' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => false, // Because involves header. 'strategy' => 'defer', ) ); } // Responsive embeds script. wp_enqueue_script( 'twenty-twenty-one-responsive-embeds-script', get_template_directory_uri() . '/assets/js/responsive-embeds.js', array( 'twenty-twenty-one-ie11-polyfills' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); } add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' ); /** * Enqueues block editor script. * * @since Twenty Twenty-One 1.0 * * @return void */ function twentytwentyone_block_editor_script() { wp_enqueue_script( 'twentytwentyone-editor', get_theme_file_uri( '/assets/js/editor.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); } add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' ); /** * Fixes skip link focus in IE11. * * This does not enqueue the script because it is tiny and because it is only for IE11, * thus it does not warrant having an entire dedicated blocking script being loaded. * * @since Twenty Twenty-One 1.0 * @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action. * * @link https://git.io/vWdr2 */ function twenty_twenty_one_skip_link_focus_fix() { // If SCRIPT_DEBUG is defined and true, print the unminified file. if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { echo '<script>'; include get_template_directory() . '/assets/js/skip-link-focus-fix.js'; echo '</script>'; } else { // The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`. ?> <script> /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1); </script> <?php } } /** * Enqueues non-latin language styles. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_non_latin_languages() { $custom_css = twenty_twenty_one_get_non_latin_css( 'front-end' ); if ( $custom_css ) { wp_add_inline_style( 'twenty-twenty-one-style', $custom_css ); } } add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_non_latin_languages' ); // SVG Icons class. require get_template_directory() . '/classes/class-twenty-twenty-one-svg-icons.php'; // Custom color classes. require get_template_directory() . '/classes/class-twenty-twenty-one-custom-colors.php'; new Twenty_Twenty_One_Custom_Colors(); // Enhance the theme by hooking into WordPress. require get_template_directory() . '/inc/template-functions.php'; // Menu functions and filters. require get_template_directory() . '/inc/menu-functions.php'; // Custom template tags for the theme. require get_template_directory() . '/inc/template-tags.php'; // Customizer additions. require get_template_directory() . '/classes/class-twenty-twenty-one-customize.php'; new Twenty_Twenty_One_Customize(); // Block Patterns. require get_template_directory() . '/inc/block-patterns.php'; // Block Styles. require get_template_directory() . '/inc/block-styles.php'; // Dark Mode. require_once get_template_directory() . '/classes/class-twenty-twenty-one-dark-mode.php'; new Twenty_Twenty_One_Dark_Mode(); /** * Enqueues scripts for the customizer preview. * * @since Twenty Twenty-One 1.0 * * @return void */ function twentytwentyone_customize_preview_init() { wp_enqueue_script( 'twentytwentyone-customize-helpers', get_theme_file_uri( '/assets/js/customize-helpers.js' ), array(), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); wp_enqueue_script( 'twentytwentyone-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery', 'twentytwentyone-customize-helpers' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); } add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' ); /** * Enqueues scripts for the customizer. * * @since Twenty Twenty-One 1.0 * * @return void */ function twentytwentyone_customize_controls_enqueue_scripts() { wp_enqueue_script( 'twentytwentyone-customize-helpers', get_theme_file_uri( '/assets/js/customize-helpers.js' ), array(), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) ); } add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' ); /** * Calculates classes for the main <html> element. * * @since Twenty Twenty-One 1.0 * * @return void */ function twentytwentyone_the_html_classes() { /** * Filters the classes for the main <html> element. * * @since Twenty Twenty-One 1.0 * * @param string The list of classes. Default empty string. */ $classes = apply_filters( 'twentytwentyone_html_classes', '' ); if ( ! $classes ) { return; } echo 'class="' . esc_attr( $classes ) . '"'; } /** * Adds "is-IE" class to body if the user is on Internet Explorer. * * @since Twenty Twenty-One 1.0 * * @return void */ function twentytwentyone_add_ie_class() { ?> <script> if ( -1 !== navigator.userAgent.indexOf( 'MSIE' ) || -1 !== navigator.appVersion.indexOf( 'Trident/' ) ) { document.body.classList.add( 'is-IE' ); } </script> <?php } add_action( 'wp_footer', 'twentytwentyone_add_ie_class' ); if ( ! function_exists( 'wp_get_list_item_separator' ) ) : /** * Retrieves the list item separator based on the locale. * * Added for backward compatibility to support pre-6.0.0 WordPress versions. * * @since 6.0.0 */ function wp_get_list_item_separator() { /* translators: Used between list items, there is a space after the comma. */ return __( ', ', 'twentytwentyone' ); } endif; ���������������������������������������������������������������������������������������������������������������������������������������������������������������home/eticmes/www/wp-content/plugins/meta-box/inc/functions.php��������������������������������������0000644�����������������00000022775�15155767721�0020573 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Plugin public functions. */ if ( ! function_exists( 'rwmb_meta' ) ) { /** * Get post meta. * * @param string $key Meta key. Required. * @param array $args Array of arguments. Optional. * @param int|null $post_id Post ID. null for current post. Optional. * * @return mixed */ function rwmb_meta( $key, $args = [], $post_id = null ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $key, $args, $post_id ); /* * If field is not found, which can caused by registering meta boxes for the backend only or conditional registration. * Then fallback to the old method to retrieve meta (which uses get_post_meta() as the latest fallback). */ if ( false === $field ) { $value = rwmb_meta_legacy( $key, $args, $post_id ); return apply_filters( 'rwmb_meta', $value, $key, $args, $post_id ); } $value = in_array( $field['type'], [ 'oembed', 'map', 'osm' ], true ) ? rwmb_the_value( $key, $args, $post_id, false ) : rwmb_get_value( $key, $args, $post_id ); return apply_filters( 'rwmb_meta', $value, $key, $args, $post_id ); } } if ( ! function_exists( 'rwmb_set_meta' ) ) { /** * Set meta value. * * @param int $object_id Object ID. Required. * @param string $key Meta key. Required. * @param mixed $value Meta value. Required. * @param array $args Array of arguments. Optional. */ function rwmb_set_meta( $object_id, $key, $value, $args = [] ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $key, $args, $object_id ); if ( false === $field ) { return; } $old = RWMB_Field::call( $field, 'raw_meta', $object_id ); $new = RWMB_Field::process_value( $value, $object_id, $field ); RWMB_Field::call( $field, 'save', $new, $old, $object_id ); // For MB Custom Table to flush data from the cache to the database. do_action( 'rwmb_flush_data', $object_id, $field, $args ); } } if ( ! function_exists( 'rwmb_get_field_settings' ) ) { /** * Get field settings. * * @param string $key Meta key. Required. * @param array $args Array of arguments. Optional. * @param int|null $object_id Object ID. null for current post. Optional. * * @return array */ function rwmb_get_field_settings( $key, $args = [], $object_id = null ) { $args = wp_parse_args( $args, [ 'object_type' => 'post', 'type' => '', ] ); /** * Filter meta type from object type and object id. * * @var string Meta type, default is post type name. * @var string Object type. * @var ?string|?int Object id. */ $type = apply_filters( 'rwmb_meta_type', $args['type'], $args['object_type'], $object_id ); if ( ! $type ) { $type = get_post_type( $object_id ); } return rwmb_get_registry( 'field' )->get( $key, $type, $args['object_type'] ); } } if ( ! function_exists( 'rwmb_meta_legacy' ) ) { /** * Get post meta. * * @param string $key Meta key. Required. * @param array $args Array of arguments. Optional. * @param int|null $post_id Post ID. null for current post. Optional. * * @return mixed */ function rwmb_meta_legacy( $key, $args = [], $post_id = null ) { $args = wp_parse_args( $args, [ 'type' => 'text', 'multiple' => false, 'clone' => false, ] ); $field = [ 'id' => $key, 'type' => $args['type'], 'clone' => $args['clone'], 'multiple' => $args['multiple'], ]; $method = 'get_value'; switch ( $args['type'] ) { case 'taxonomy': case 'taxonomy_advanced': $field['taxonomy'] = $args['taxonomy']; break; case 'map': case 'osm': case 'oembed': $method = 'the_value'; break; } $field = RWMB_Field::call( 'normalize', $field ); return RWMB_Field::call( $method, $field, $args, $post_id ); } } if ( ! function_exists( 'rwmb_get_value' ) ) { /** * Get value of custom field. * This is used to replace old version of rwmb_meta key. * * @param string $field_id Field ID. Required. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * * @return mixed false if field doesn't exist. Field value otherwise. */ function rwmb_get_value( $field_id, $args = [], $post_id = null ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $field_id, $args, $post_id ); // Get field value. $value = $field ? RWMB_Field::call( 'get_value', $field, $args, $post_id ) : false; /* * Allow developers to change the returned value of field. * For version < 4.8.2, the filter name was 'rwmb_get_field'. * * @param mixed $value Field value. * @param array $field Field parameters. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. */ $value = apply_filters( 'rwmb_get_value', $value, $field, $args, $post_id ); return $value; } } if ( ! function_exists( 'rwmb_the_value' ) ) { /** * Display the value of a field * * @param string $field_id Field ID. Required. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * @param bool $echo Display field meta value? Default `true` which works in almost all cases. We use `false` for the [rwmb_meta] shortcode. * * @return string */ function rwmb_the_value( $field_id, $args = [], $post_id = null, $echo = true ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $field_id, $args, $post_id ); if ( ! $field ) { return ''; } $output = RWMB_Field::call( 'the_value', $field, $args, $post_id ); /* * Allow developers to change the returned value of field. * For version < 4.8.2, the filter name was 'rwmb_get_field'. * * @param mixed $value Field HTML output. * @param array $field Field parameters. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. */ $output = apply_filters( 'rwmb_the_value', $output, $field, $args, $post_id ); if ( $echo ) { echo $output; // phpcs:ignore WordPress.Security.EscapeOutput } return $output; } } if ( ! function_exists( 'rwmb_get_object_fields' ) ) { /** * Get defined meta fields for object. * * @param int|string $type_or_id Object ID or post type / taxonomy (for terms) / user (for users). * @param string $object_type Object type. Use post, term. * * @return array */ function rwmb_get_object_fields( $type_or_id, $object_type = 'post' ) { $meta_boxes = rwmb_get_registry( 'meta_box' )->get_by( [ 'object_type' => $object_type ] ); array_walk( $meta_boxes, 'rwmb_check_meta_box_supports', [ $object_type, $type_or_id ] ); $meta_boxes = array_filter( $meta_boxes ); $fields = []; foreach ( $meta_boxes as $meta_box ) { foreach ( $meta_box->fields as $field ) { $fields[ $field['id'] ] = $field; } } return $fields; } } if ( ! function_exists( 'rwmb_check_meta_box_supports' ) ) { /** * Check if a meta box supports an object. * * @param object $meta_box Meta Box object. * @param int $key Not used. * @param array $object_data Object data (type and ID). */ function rwmb_check_meta_box_supports( &$meta_box, $key, $object_data ) { list( $object_type, $type_or_id ) = $object_data; $type = null; $prop = null; switch ( $object_type ) { case 'post': $type = is_numeric( $type_or_id ) ? get_post_type( $type_or_id ) : $type_or_id; $prop = 'post_types'; break; case 'term': $type = $type_or_id; if ( is_numeric( $type_or_id ) ) { $term = get_term( $type_or_id ); $type = is_wp_error( $term ) || ! $term ? null : $term->taxonomy; } $prop = 'taxonomies'; break; case 'user': $type = 'user'; $prop = 'user'; break; case 'setting': $type = $type_or_id; $prop = 'settings_pages'; break; } if ( ! $type ) { $meta_box = false; return; } if ( isset( $meta_box->meta_box[ $prop ] ) && ! in_array( $type, $meta_box->meta_box[ $prop ], true ) ) { $meta_box = false; } } } if ( ! function_exists( 'rwmb_get_registry' ) ) { /** * Get the registry by type. * Always return the same instance of the registry. * * @param string $type Registry type. * * @return object */ function rwmb_get_registry( $type ) { static $data = []; $class = 'RWMB_' . RWMB_Helpers_String::title_case( $type ) . '_Registry'; if ( ! isset( $data[ $type ] ) ) { $data[ $type ] = new $class(); } return $data[ $type ]; } } if ( ! function_exists( 'rwmb_get_storage' ) ) { /** * Get storage instance. * * @param string $object_type Object type. Use post or term. * @param RW_Meta_Box $meta_box Meta box object. Optional. * @return RWMB_Storage_Interface */ function rwmb_get_storage( $object_type, $meta_box = null ) { $class = 'RWMB_' . RWMB_Helpers_String::title_case( $object_type ) . '_Storage'; $class = class_exists( $class ) ? $class : 'RWMB_Post_Storage'; $storage = rwmb_get_registry( 'storage' )->get( $class ); return apply_filters( 'rwmb_get_storage', $storage, $object_type, $meta_box ); } } if ( ! function_exists( 'rwmb_request' ) ) { /** * Get request object. * * @return RWMB_Request */ function rwmb_request() { static $request; if ( ! $request ) { $request = new RWMB_Request(); } return $request; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������