芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/clients/origami-events.com/wp-content/themes/kallyas/th-custom-hooks.php
>> WP HOOKS - CUSTOM"> /** * Add page loading */ add_action( 'zn_after_body', 'zn_add_page_loading', 10 ); /** * Add the Support Panel */ add_action( 'zn_after_body', 'zn_add_hidden_panel', 10 ); /** * Display the login form */ add_action( 'zn_after_body', 'zn_add_login_form', 10 ); /** * Open Graph */ add_action( 'zn_after_body', 'zn_add_open_graph', 10 ); /** * Display the Info Card when you hover over the logo. */ add_action( 'zn_show_infocard', 'kfn_showInfoCard' ); /** * Remove the scripts added to the page footer by the nextgen-gallery plugin */ if(class_exists('C_Photocrati_Resource_Manager')) { remove_action('wp_print_footer_scripts', array('C_Photocrati_Resource_Manager', 'get_resources'), 1); } /* * @since 4.0 * Fixes issue with JetPack Comments */ add_filter( 'comment_form_default_fields' , 'zn_wp_comment_filter', 98 ); add_filter( 'comment_form_field_comment' , 'zn_wp_comment_form_field_comment', 98 ); if ( !function_exists('zn_wp_comment_filter') ){ function zn_wp_comment_filter( $fields ) { $fields['author'] = str_replace( '
' .$fields['author'].'
'; $fields['email'] = '
' .$fields['email'].'
'; $fields['url'] = '
' .$fields['url'].'
'; return $fields; } } if ( !function_exists('zn_wp_comment_form_field_comment') ){ function zn_wp_comment_form_field_comment( $textarea ){ $textarea = str_replace( '
'. $textarea .'
'; return $textarea; } } /* * Update custom fonts paths in case domain changed * * @since v4.15.6 */ add_action( 'admin_init', 'znhg_update_font_paths', 2, 80000 ); function znhg_update_font_paths(){ if( ! ZNHGFW()->isDomainChanged() ){ return; } //#! Get theme options $optName = ZNHGTFW()->getThemeDbId(); //#! Get custom fonts $customFontsOptions = zget_option( 'zn_custom_fonts', 'google_font_options' ); if( empty($customFontsOptions)){ return; } //#! Check if domain changed and update font paths $currentDomain = home_url(); // Get the saved domain from DB. Note that the domain URI is reversed at this point $savedDomain = get_option( 'znhgfw_current_domain' ); //#! Get theme options $themeOptions = get_option( $optName ); //#! Flag to see whether or not we had changes $hasChanges = false; //#! Update paths foreach( $customFontsOptions as $i => &$entry ){ if( isset($entry['cf_woff'])){ $hasChanges = true; $entry['cf_woff'] = str_ireplace( $savedDomain, $currentDomain, $entry['cf_woff'] ); } if( isset($entry['cf_ttf'])){ $hasChanges = true; $entry['cf_ttf'] = str_ireplace( $savedDomain, $currentDomain, $entry['cf_ttf'] ); } if( isset($entry['cf_svg'])){ $hasChanges = true; $entry['cf_svg'] = str_ireplace( $savedDomain, $currentDomain, $entry['cf_svg'] ); } if( isset($entry['cf_eot'])){ $hasChanges = true; $entry['cf_eot'] = str_ireplace( $savedDomain, $currentDomain, $entry['cf_eot'] ); } } //#! Update options if we have changes if( $hasChanges ){ $themeOptions['google_font_options']['zn_custom_fonts'] = $customFontsOptions; update_option( $optName, $themeOptions ); } } //>> WP HOOKS - CUSTOM">