• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpgrade类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpgrade的典型用法代码示例。如果您正苦于以下问题:PHP wpgrade类的具体用法?PHP wpgrade怎么用?PHP wpgrade使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wpgrade类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpgrade_callback_enqueue_dynamic_css

function wpgrade_callback_enqueue_dynamic_css()
{
    $style_query = array();
    //		if (wpgrade::option('main_color')) {
    //			$main_color = wpgrade::option('main_color');
    //			$main_color = str_replace('#', '', $main_color);
    //			$style_query['color'] = $main_color;
    //		}
    if (wpgrade::option('use_google_fonts')) {
        add_action('wp_head', 'wpgrade_callback_load_google_fonts');
        $fonts_array = array('google_titles_font', 'google_second_font', 'google_nav_font', 'google_body_font');
        foreach ($fonts_array as $font) {
            $the_font = wpgrade::get_the_typo($font);
            //				var_dump($the_font);
            if (!empty($the_font)) {
                $style_query['fonts'][$font] = $the_font;
            }
        }
    }
    //		if (wpgrade::option('portfolio_text_color')) {
    //			$port_color = wpgrade::option('portfolio_text_color');
    //			$port_color = str_replace('#', '', $port_color);
    //			$style_query['port_color'] = $port_color;
    //		}
    if (wpgrade::option('inject_custom_css') == 'file') {
        wp_enqueue_style('wpgrade-custom-style', get_template_directory_uri() . '/theme-content/css/custom.css');
    }
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:28,代码来源:dynamic-css.php


示例2: render_content

 /**
  * A custom render for sliders in customizer panel
  */
 public function render_content()
 {
     $field = search_multi($this->ReduxFramework->sections, 'id', $this->option_key);
     // the key is always unique so there will be only one
     $field = $field[0];
     if (!isset($field['name_suffix'])) {
         $field['name_suffix'] = "";
     }
     if (!isset($field['default'])) {
         $field['default'] = array();
     }
     $field['custom_data'] = $this->get_link();
     $field_class = 'ReduxFramework_customizer_background';
     if (!class_exists($field_class)) {
         $class_file = apply_filters('redux-typeclass-load', '/inc/fields/background/field_background.php', $field_class);
         if ($class_file === '/inc/fields/background/field_background.php') {
             /** @noinspection PhpIncludeInspection */
             require_once wpgrade::corepath() . 'vendor/redux3/' . $class_file;
         }
     }
     $value = wpgrade::option($field['id'], $field['default']);
     // get wordpress default labels
     $this->json['button_labels'] = array('select' => __('Select Image'), 'change' => __('Change Image'), 'remove' => __('Remove'), 'default' => __('Default'), 'placeholder' => __('No image selected'), 'frame_title' => __('Select Image'), 'frame_button' => __('Choose Image'));
     if (class_exists($field_class) && method_exists($field_class, 'render')) {
         $field_object = new $field_class($field, $value, $this->ReduxFramework);
         //				$enqueue->enqueue();
         echo "<label>" . "<span class=\"customize-control-title\">" . $field['title'] . "</span>" . "</label>";
         //				echo '<div class="redux-container-'. $this->type . '" >';
         echo $field_object->render();
         //				echo '<div>';
     }
 }
开发者ID:pwzCypher,项目名称:wp-push,代码行数:35,代码来源:background.php


示例3: wpgrade_update_notifier_latest_theme_version

/**
 * Get the remote XML file contents and return its data (Version
 * and Changelog). Uses the cached version if available and inside the time
 * interval defined
 */
function wpgrade_update_notifier_latest_theme_version($interval)
{
    $notifier_file_url = wpgrade::updade_notifier_xml();
    $db_cache_field = 'notifier-cache-' . wpgrade::shortname();
    $db_cache_field_last_updated = 'notifier-cache-last-updated-' . wpgrade::shortname();
    $last = get_option($db_cache_field_last_updated);
    $now = time();
    // check the cache
    if (!$last || $now - $last > $interval) {
        // cache doesn't exist, or is old, so refresh it
        $res = wp_remote_get($notifier_file_url);
        $cache = wp_remote_retrieve_body($res);
        if ($cache) {
            // we got good results
            update_option($db_cache_field, $cache);
            update_option($db_cache_field_last_updated, time());
        }
        // read from the cache file
        $notifier_data = get_option($db_cache_field);
    } else {
        // cache file is fresh enough, so read from it
        $notifier_data = get_option($db_cache_field);
    }
    // Let's see if the $xml data was returned as we expected it to.
    // If it didn't, use the default 1.0 as the latest version so that we don't have problems when the remote server hosting the XML file is down
    if (strpos((string) $notifier_data, '<notifier>') === false) {
        $notifier_data = '<?xml version="1.0" encoding="UTF-8"?><notifier><latest>1.0</latest><changelog></changelog></notifier>';
    }
    // Load the remote XML data into a variable and return it
    $xml = simplexml_load_string($notifier_data);
    return $xml;
}
开发者ID:pwzCypher,项目名称:wp-push,代码行数:37,代码来源:helpers.php


示例4: render_content

 public function render_content()
 {
     $field = search_multi($this->ReduxFramework->sections, 'id', $this->option_key);
     // the key is always unique so there will be only one
     $field = $field[0];
     if (!isset($field['name_suffix'])) {
         $field['name_suffix'] = "";
     }
     if (!isset($field['default'])) {
         $field['default'] = array();
     }
     $field['custom_data'] = $this->get_link();
     $field_class = 'ReduxFramework_customizer_checkbox';
     if (!class_exists($field_class)) {
         $class_file = apply_filters('redux-typeclass-load', '/inc/fields/checkbox/field_checkbox.php', $field_class);
         if ($class_file === 'inc/fields/checkbox/field_checkbox.php') {
             /*  for PRO users! - * @noinspection PhpIncludeInspection */
             require_once wpgrade::corepath() . 'vendor/redux3/' . $class_file;
         }
     }
     $value = wpgrade::option($field['id'], 0);
     if (class_exists($field_class) && method_exists($field_class, 'render')) {
         $enqueue = new $field_class($field, $value, $this->ReduxFramework);
         //				$enqueue->enqueue();
         echo "<label>" . "<span class=\"customize-control-title\">" . $field['title'] . "</span>" . "</label>";
         echo '<div class="redux-container-' . $this->type . '">';
         echo $enqueue->render();
         echo '<div>';
     }
 }
开发者ID:qhuit,项目名称:Tournesol,代码行数:30,代码来源:checkbox.php


示例5: wpgrade_callback_geting_active

/**
 * Theme activation hook
 */
function wpgrade_callback_geting_active()
{
    /**
     * Get the config from /config/activation.php
     */
    $activation_settings = array();
    if (file_exists(wpgrade::themepath() . 'config/activation' . EXT)) {
        $activation_settings = (include wpgrade::themepath() . 'config/activation' . EXT);
    }
    /**
     * Make sure pixlikes has the right settings
     */
    if (isset($activation_settings['pixlikes-settings'])) {
        $pixlikes_settings = $activation_settings['pixlikes-settings'];
        update_option('pixlikes_settings', $pixlikes_settings);
    }
    /**
     * Create custom post types, taxonomies and metaboxes
     * These will be taken by pixtypes plugin and converted in their own options
     */
    if (isset($activation_settings['pixtypes-settings'])) {
        $pixtypes_conf_settings = $activation_settings['pixtypes-settings'];
        $types_options = get_option('pixtypes_themes_settings');
        if (empty($types_options)) {
            $types_options = array();
        }
        $theme_key = wpgrade::shortname() . '_pixtypes_theme';
        $types_options[$theme_key] = $pixtypes_conf_settings;
        update_option('pixtypes_themes_settings', $types_options);
    }
    /**
     * http://wordpress.stackexchange.com/questions/36152/flush-rewrite-rules-not-working-on-plugin-deactivation-invalid-urls-not-showing
     */
    delete_option('rewrite_rules');
}
开发者ID:pwzCypher,项目名称:wp-push,代码行数:38,代码来源:activation-hooks.php


示例6: setup

 protected function setup()
 {
     // the boring defaults that are ommited in the wpgrade-config.php
     // configuration for clarity and bravity, and also because some require
     // extensive logic handling
     $defaults = array('base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))), 'format' => $this->pager_format($this->pager), 'current' => max(1, get_query_var($this->pager)), 'total' => $this->query->max_num_pages, 'formatter' => null, 'prev_next' => true, 'sorted_paging' => false, 'order' => 'desc', 'show_all' => false, 'end_size' => 1, 'mid_size' => 2, 'add_args' => false, 'add_fragment' => null);
     $conf = wpgrade::merge($defaults, $this->conf);
     # we're filling in prev_text and next_text seperatly to avoid
     # requesting the translation when not required
     if (empty($conf['prev_text'])) {
         $conf['prev_text'] = __('&laquo; Previous', 'rosa_txtd');
     } else {
         // exists; translate
         $conf['prev_text'] = __($conf['prev_text'], 'rosa_txtd');
     }
     if (empty($conf['next_text'])) {
         $conf['next_text'] = __('Next &raquo;', 'rosa_txtd');
     } else {
         // exists; translate
         $conf['next_text'] = __($conf['next_text'], 'rosa_txtd');
     }
     // is the pager sorted?
     if ($conf['sorted_paging'] && $conf['order'] == 'asc') {
         $temp = $conf['prev_text'];
         $conf['prev_text'] = $conf['next_text'];
         $conf['next_text'] = $temp;
     }
     return $conf;
 }
开发者ID:pwzCypher,项目名称:wp-push,代码行数:29,代码来源:WPGradePaginationFormatter.php


示例7: wpgrade_register_custom_menus

function wpgrade_register_custom_menus()
{
    add_theme_support('menus');
    $menus = wpgrade::confoption('import_nav_menu');
    foreach ($menus as $key => $value) {
        register_nav_menu($key, $value);
    }
}
开发者ID:pwzCypher,项目名称:wp-push,代码行数:8,代码来源:menus.php


示例8: instance

 static function instance($reinitialize = false)
 {
     if (self::$instance == null || $reinitialize) {
         $config = wpgrade::config();
         self::$instance = new WPGradeOptions($config['theme-options']);
     }
     return self::$instance;
 }
开发者ID:qhuit,项目名称:Tournesol,代码行数:8,代码来源:WPGradeOptions.php


示例9: wpgrade_clean_static_files

function wpgrade_clean_static_files()
{
    if (wpgrade::option('remove_parameters_from_static_res')) {
        add_filter('the_generator', 'wpgrade_remove_version_info');
        add_filter('script_loader_src', 'wpgrade_remove_script_version', 15, 1);
        add_filter('style_loader_src', 'wpgrade_remove_script_version', 15, 1);
    }
}
开发者ID:pwzCypher,项目名称:wp-push,代码行数:8,代码来源:pagespeed-optimizations.php


示例10: wpgrade_callback_load_woocommerce_assets

function wpgrade_callback_load_woocommerce_assets()
{
    global $woocommerce;
    if (!wpgrade::option('enable_woocommerce_support', '0')) {
        return;
    }
    wp_enqueue_style('wpgrade-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css', array('woocommerce-general'), wpgrade::cachebust_string(wpgrade::themefilepath('assets/css/woocommerce.css')));
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:8,代码来源:woocommerce.php


示例11: wpgrade_callback_inlined_custom_style

function wpgrade_callback_inlined_custom_style()
{
    ob_start();
    include wpgrade::corepartial('inline-custom-css' . EXT);
    $custom_css = ob_get_clean();
    $style = 'wpgrade-main-style';
    wp_add_inline_style($style, $custom_css);
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:8,代码来源:inline-custom-style.php


示例12: __construct

 function __construct()
 {
     $widget_ops = array('classname' => 'widget--latest-comments', 'description' => __('The latest comments', 'rosa_txtd'));
     parent::__construct('recent-comments', wpgrade::themename() . ' ' . __('Latest Comments', 'rosa_txtd'), $widget_ops);
     $this->alt_option_name = 'widget_recent_comments';
     add_action('comment_post', array($this, 'flush_widget_cache'));
     add_action('transition_comment_status', array($this, 'flush_widget_cache'));
 }
开发者ID:qhuit,项目名称:Tournesol,代码行数:8,代码来源:wpgrade_latest_comments.php


示例13: remove_customizer_controls

function remove_customizer_controls($wp_customize)
{
    $sections = wpgrade::get_redux_arg('remove_customizer_sections');
    if (!empty($sections) && is_array($sections)) {
        foreach ($sections as $key => $section) {
            $wp_customize->remove_section($section);
        }
    }
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:9,代码来源:redux-extend.php


示例14: wpGrade_ajax_import_widgets

 function wpGrade_ajax_import_widgets()
 {
     $response = array('what' => 'import_widgets', 'action' => 'import_submit', 'id' => 'true');
     // check if user is allowed to save and if its his intention with
     // a nonce check
     if (function_exists('check_ajax_referer')) {
         check_ajax_referer('wpGrade_nonce_import_demo_widgets');
     }
     require_once wpgrade::themefilepath('inc/import/import-demo-widgets' . EXT);
     $response = new WP_Ajax_Response($response);
     $response->send();
 }
开发者ID:pwzCypher,项目名称:wp-push,代码行数:12,代码来源:callbacks.php


示例15: get_gallery_ids

 /**
  * Get the gallery of the global post
  * @required global $post this should be called inside a loop
  * @return array $ids
  */
 function get_gallery_ids($key = '')
 {
     global $post;
     $prefix = '';
     if (class_exists('wpgrade')) {
         $prefix = wpgrade::prefix();
     }
     $ids = get_post_meta($post->ID, $prefix . $key, true);
     if (!empty($ids)) {
         $ids = explode(',', $ids);
     }
     return $ids;
 }
开发者ID:ksingh812,项目名称:epb,代码行数:18,代码来源:class-pix-query.php


示例16: wpgrade_callback_load_custom_js_footer

function wpgrade_callback_load_custom_js_footer()
{
    $custom_js = wpgrade::option('custom_js_footer');
    if (!empty($custom_js)) {
        //first lets test is the js code is clean or has <script> tags and such
        //if we have <script> tags than we will not enclose it in anything - raw output
        if (strpos($custom_js, '</script>') !== false) {
            echo $custom_js . "\n";
        } else {
            echo "<script type=\"text/javascript\">\n;(function(\$){\n" . $custom_js . "\n})(jQuery);\n</script>\n";
        }
    }
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:13,代码来源:custom-javascript.php


示例17: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $social_links = wpgrade::option('social_icons');
        $target = '';
        if (wpgrade::option('social_icons_target_blank')) {
            $target = 'target="_blank"';
        }
        // Reset Post Data
        wp_reset_postdata();
        echo $before_widget;
        if (!empty($social_links)) {
            ?>
			<?php 
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
			<div class="btn-list">
				<?php 
            foreach ($social_links as $domain => $icon) {
                if (isset($icon['value']) && isset($icon['checkboxes']['widget'])) {
                    $value = $icon['value'];
                    ?>
						<a href="<?php 
                    echo $value;
                    ?>
" <?php 
                    echo $target;
                    ?>
>
							<i class="pixcode  pixcode--icon  icon-e-<?php 
                    echo $domain;
                    ?>
"></i>
						</a>
					<?php 
                }
            }
            ?>
			</div>
		<?php 
        }
        echo $after_widget;
    }
开发者ID:pwzCypher,项目名称:wp-push,代码行数:46,代码来源:wpgrade_social_links_widget.php


示例18: wpgrade_callback_the_password_form

function wpgrade_callback_the_password_form($form)
{
    global $post;
    $post = get_post($post);
    $postID = wpgrade::lang_post_id($post->ID);
    $label = 'pwbox-' . (empty($postID) ? rand() : $postID);
    $form = '<form action="' . esc_url(site_url('wp-login.php?action=postpass', 'login_post')) . '" method="post">
		<p>' . __("This post is password protected. To view it please enter your password below:", 'rosa_txtd') . '</p>
		<div class="row">
			<div class="column  span-12  hand-span-10">
				<input name="post_password" id="' . $label . '" type="password" size="20" placeholder="' . __("Password", 'rosa_txtd') . '"/>
			</div>
			<div class="column  span-12  hand-span-2">
				<input type="submit" name="Access" value="' . esc_attr__("Access", 'rosa_txtd') . '" class="btn post-password-submit"/>
			</div>
		</div>
	</form>';
    // on form submit put a wrong passwordp msg.
    if (get_permalink() != wp_get_referer()) {
        return $form;
    }
    // No cookie, the user has not sent anything until now.
    if (!isset($_COOKIE['wp-postpass_' . COOKIEHASH])) {
        return $form;
    }
    require_once ABSPATH . 'wp-includes/class-phpass.php';
    $hasher = new PasswordHash(8, true);
    $hash = wp_unslash($_COOKIE['wp-postpass_' . COOKIEHASH]);
    if (0 !== strpos($hash, '$P$B')) {
        return $form;
    }
    if (!$hasher->CheckPassword($post->post_password, $hash)) {
        // We have a cookie, but it does not match the password.
        $msg = '<span class="wrong-password-message">' . __('Sorry, your password did not match', 'rosa_txtd') . '</span>';
        $form = $msg . $form;
    }
    return $form;
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:38,代码来源:password-protection.php


示例19: wpgrade_custom_thumbnails

function wpgrade_custom_thumbnails()
{
    // Add theme support for Featured Images
    add_theme_support('post-thumbnails');
    $sizes = wpgrade::confoption('thumbnails_sizes');
    if (!empty($sizes)) {
        foreach ($sizes as $size_key => $values) {
            $width = 0;
            if (isset($values['width'])) {
                $width = $values['width'];
            }
            $height = 0;
            if (isset($values['height'])) {
                $height = $values['height'];
            }
            $hard_crop = false;
            if (isset($values['hard_crop'])) {
                $hard_crop = $values['hard_crop'];
            }
            add_image_size($size_key, $width, $height, $hard_crop);
        }
    }
}
开发者ID:qhuit,项目名称:Tournesol,代码行数:23,代码来源:thumbnails.php


示例20: gallery_slideshow

 static function gallery_slideshow($current_post, $template = null, $size = 'medium-size')
 {
     if ($template === null) {
         $image_scale_mode = get_post_meta($current_post->ID, wpgrade::prefix() . 'post_image_scale_mode', true);
         $slider_visiblenearby = get_post_meta($current_post->ID, wpgrade::prefix() . 'post_slider_visiblenearby', true);
         $slider_transition = get_post_meta($current_post->ID, wpgrade::prefix() . 'post_slider_transition', true);
         $slider_autoplay = get_post_meta($current_post->ID, wpgrade::prefix() . 'post_slider_autoplay', true);
         if ($slider_autoplay) {
             $slider_delay = get_post_meta($current_post->ID, wpgrade::prefix() . 'post_slider_delay', true);
         }
         $template = '<div class="wp-gallery" data-royalslider data-autoHeight data-customarrows data-sliderpauseonhover data-slidertransition="' . $slider_transition . '" ';
         $template .= ' data-imagescale="' . $image_scale_mode . '" ';
         if ($slider_visiblenearby) {
             $template .= ' data-visiblenearby ';
         }
         if ($slider_autoplay) {
             $template .= ' data-sliderautoplay="" ';
             $template .= ' data-sliderdelay="' . $slider_delay . '" ';
         }
         if ($image_scale_mode != 'fill') {
             $template .= ' data-imagealigncenter ';
         }
         if (wpgrade::option('show_title_caption_popup') == 1) {
             $template .= ' data-enable_caption=""';
         }
         $template .= '>:gallery</div>';
     }
     // first check if we have a meta with a gallery
     $gallery_ids = get_post_meta($current_post->ID, wpgrade::prefix() . 'main_gallery', true);
     if (!empty($gallery_ids)) {
         //recreate the gallery shortcode
         $gallery = '[gallery ids="' . $gallery_ids . '"]';
         if (strpos($gallery, 'style') === false) {
             $gallery = str_replace("]", " style='big_thumb' size='" . $size . "' link='file']", $gallery);
         }
         $shrtcode = do_shortcode($gallery);
         //var_dump( $template, $shrtcode );
         //			$shrtcode = preg_replace('/(<dd class="wp-caption-text gallery-caption">.+?)+(<\/dd>)/i', '', $shrtcode);
         if (!empty($shrtcode)) {
             return strtr($template, array(':gallery' => $shrtcode));
         } else {
             return null;
         }
     } else {
         // empty gallery_ids
         // search for the first gallery shortcode
         $gallery_matches = null;
         preg_match("!\\[gallery.+?\\]!", $current_post->post_content, $gallery_matches);
         if (!empty($gallery_matches)) {
             $gallery = $gallery_matches[0];
             if (strpos($gallery, 'style') === false) {
                 $gallery = str_replace("]", " style='big_thumb' size='" . $size . "' link='file']", $gallery);
             }
             $shrtcode = do_shortcode($gallery);
             if (!empty($shrtcode)) {
                 return strtr($template, array(':gallery' => $shrtcode));
             } else {
                 return null;
             }
         } else {
             // gallery_matches is empty
             return null;
         }
     }
 }
开发者ID:qhuit,项目名称:Tournesol,代码行数:65,代码来源:rosa.php



注:本文中的wpgrade类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpl_global类代码示例发布时间:2022-05-23
下一篇:
PHP wpdreamsType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap