当前位置: 首页>>代码示例>>PHP>>正文


PHP ZN函数代码示例

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


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

示例1: upload

 function upload($option)
 {
     // ONLY ALLOW SUPER ADMINS TO UPLOAD NEW ICONS
     if (!current_user_can('update_plugins')) {
         return 'You need super admin capabilities to use this option!';
     }
     // GET/SET DEFAULTS
     $supports = $option['supports'];
     $output = '';
     // CHECK TO SEE IF THE FILE TYPE IS ALLOWED
     // CHECK ON MULTISITE
     if (is_multisite() && strpos(get_site_option('upload_filetypes'), $supports['file_extension']) === false) {
         return 'It seems that the ' . $supports['file_extension'] . ' file type is not allowed on your multisite enable network. Please go to <a title="Network settings page" href="' . network_admin_url('settings.php') . '"">Network settings page</a> and add the ' . $supports['file_extension'] . ' file extension to the list of "Upload file types"';
     }
     // CHECK TO SEE IF ZIPARCHIVE IS INSTALLED ON THE SERVER
     if (!class_exists('ZipArchive')) {
         return 'It seems that the "ZipArchive" class is not installed on your server. Please contact your server administrator and ask them to enable this class in order to use this option.';
     }
     $output .= '<div class="zn_file_upload zn_admin_button" data-file_type="' . $supports['file_type'] . '" data-button="Upload" data-title="Upload File">Select file</div>';
     $output .= '<div class="uploads_container">';
     $fonts = ZN()->icon_manager->get_custom_fonts();
     if (!empty($fonts)) {
         foreach ($fonts as $key => $font) {
             $output .= '<a class="zn_remove_font" href="#">' . $key . '<span data-font_name="' . $key . '" class="zn_remove_font_trigger">&#215;</span></a> ';
         }
     }
     $output .= '</div>';
     return $output;
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:29,代码来源:class-html.php

示例2: check_version

 /**
  * check_version function.
  */
 public function check_version()
 {
     if (get_option($this->theme_old_version) != ZN()->theme_data['version'] || get_option($this->theme_db_version) != ZN()->theme_data['version']) {
         $this->install();
         do_action('zn_theme_installed');
     }
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:10,代码来源:class-install.php

示例3: add_inline_css

 function add_inline_css()
 {
     $css = get_post_meta(zn_get_the_id(), 'zn_page_custom_css', true);
     if (!empty($css)) {
         ZN()->add_inline_css($css);
     }
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:7,代码来源:class-page-builder-custom-code.php

示例4: __construct

 function __construct()
 {
     if (ZN()->is_request('admin')) {
         require FW_PATH . '/classes/class-mega-menu-admin.php';
     }
     // ADD THE MEGA MENU WALKER AND CLASSES
     add_filter('wp_nav_menu_args', array(&$this, 'enable_custom_walker'), 100);
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:8,代码来源:class-mega-menu.php

示例5: zn_check_updates

 function zn_check_updates()
 {
     $option_name = ZN()->theme_data['theme_id'] . '_update_config';
     $saved_config = get_option($option_name);
     if (!empty($saved_config['tf_username']) && !empty($saved_config['tf_api']) && !empty($this->config['author'])) {
         require_once FW_PATH . '/modules/envato_theme_updater/class-pixelentity-theme-update.php';
         PixelentityThemeUpdate::init($saved_config['tf_username'], $saved_config['tf_api'], $this->config['author']);
     }
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:9,代码来源:class-theme-updater.php

示例6: zn_print_scripts

 function zn_print_scripts($hook)
 {
     /* Set default theme pages where the js and css should be loaded */
     $about_pages = array('dashboard_page_zn-update');
     if (!in_array($hook, $about_pages)) {
         return;
     }
     // Load the framework assets
     ZN()->load_html_scripts();
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:10,代码来源:class-zn-about.php

示例7: add_inline_code

 function add_inline_code()
 {
     $css = get_post_meta(zn_get_the_id(), 'zn_page_custom_css', true);
     $js = get_post_meta(zn_get_the_id(), 'zn_page_custom_js', true);
     if (!empty($css)) {
         ZN()->add_inline_css($css);
     }
     if (!empty($js)) {
         ZN()->add_inline_js(array('zn_page_custom_js' => $js));
     }
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:11,代码来源:class-page-builder-custom-code.php

示例8: zn_update_405

function zn_update_405()
{
    $uploads = wp_upload_dir();
    $file_path = trailingslashit($uploads['basedir']) . 'zn_custom_css.css';
    // Change the custom css saving from file to DB
    if (file_exists($file_path)) {
        $saved_css = file_get_contents($file_path);
        if (!empty($saved_css)) {
            update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_css', $saved_css, false);
        }
        @unlink($file_path);
    }
}
开发者ID:rock1media,项目名称:wordpress,代码行数:13,代码来源:update_config.php

示例9: zn_add_custom_css_saving

function zn_add_custom_css_saving($saved_options)
{
    if (isset($saved_options['advanced_options']['custom_css'])) {
        $custom_css = $saved_options['advanced_options']['custom_css'];
        update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_css', $custom_css, false);
        // Remove custom css from the main options field
        unset($saved_options['advanced_options']['custom_css']);
    }
    if (isset($saved_options['advanced_options']['custom_js'])) {
        $custom_js = $saved_options['advanced_options']['custom_js'];
        update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_js', $custom_js, true);
        // Remove custom css from the main options field
        unset($saved_options['advanced_options']['custom_js']);
    }
    return $saved_options;
}
开发者ID:rock1media,项目名称:wordpress,代码行数:16,代码来源:theme_config.php

示例10: element

    function element()
    {
        // print_z($this);
        $elm_classes = array();
        $elm_classes[] = $uid = $this->data['uid'];
        $elm_classes[] = $this->opt('css_class', '');
        $eq_pad_start = '';
        $eq_pad_end = '';
        $eq_pad_type = $this->opt('pad_type', '');
        if (!empty($eq_pad_type)) {
            $eq_pad_start = '<div class="zn_col_' . $eq_pad_type . '">';
            $eq_pad_end = '</div>';
        }
        ?>

	<div class="zn_custom_container <?php 
        echo implode(' ', $elm_classes);
        ?>
 clearfix">
		<?php 
        echo $eq_pad_start;
        ?>
			<div class="row zn_columns_container zn_content <?php 
        echo $this->opt('gutter_size', '');
        ?>
" data-droplevel="1">
				<?php 
        if (empty($this->data['content'])) {
            $column = ZN()->pagebuilder->add_module_to_layout('ZnColumn', array(), array(), 'col-sm-12');
            $this->data['content'] = array($column);
        }
        if (!empty($this->data['content'])) {
            ZN()->pagebuilder->zn_render_content($this->data['content']);
        }
        ?>
			</div>
		<?php 
        echo $eq_pad_end;
        ?>
	</div><!-- /.zn_custom_container -->


	<?php 
    }
开发者ID:rock1media,项目名称:wordpress,代码行数:44,代码来源:custom_container.php

示例11: element

    function element()
    {
        $column_offset = $this->opt('column_offset') && !ZN()->pagebuilder->is_active_editor ? ' ' . $this->opt('column_offset') . ' ' : '';
        $width = $this->data['width'] ? $this->data['width'] : 'col-md-12';
        $size_small = $this->opt('size_small', str_replace("md", "sm", $width));
        $size_xsmall = $this->opt('size_xsmall', '');
        $size_large = $this->opt('size_large', '');
        ?>

		<div class="<?php 
        echo $this->data['uid'];
        ?>
 <?php 
        echo $column_offset . ' ' . $width . ' ' . $size_small . ' ' . $size_xsmall . ' ' . $size_large . ' ' . $this->opt('css_class', '');
        ?>
 zn_sortable_content zn_content " data-droplevel="2">
			<?php 
        ZN()->pagebuilder->zn_render_content($this->data['content']);
        ?>
		</div>
	<?php 
    }
开发者ID:rock1media,项目名称:wordpress,代码行数:22,代码来源:column.php

示例12: zn_render_meta_box

 function zn_render_meta_box($post, $metabox)
 {
     // Get the current metabox
     $zn_metabox = $metabox['args']['what_box'];
     $output = '';
     //var_dump( get_post_meta($post->ID) );
     $output .= ZN()->html->zn_render_meta_start($zn_metabox['slug']);
     if (!empty($this->metaboxes_options)) {
         foreach ($this->metaboxes_options as $key => $element) {
             if (in_array($metabox['id'], $element['slug'])) {
                 if (method_exists(ZN()->html, $element['type'])) {
                     $saved_value = get_post_meta($post->ID, $element['id'], true);
                     if (!empty($saved_value)) {
                         $element['std'] = $saved_value;
                     }
                     $output .= ZN()->html->zn_render_single_option($element);
                 }
             }
         }
     }
     $output .= ZN()->html->zn_render_meta_end();
     $output .= wp_nonce_field('zn_ajax_nonce', 'zn_ajax_nonce', false, false);
     echo $output;
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:24,代码来源:class-metaboxes.php

示例13: do_action

do_action('zn_pb_editor_right');
?>
			</div>

			<input class="zn_pb_search" type="search" placeholder="Search for an element"/>
			<a class="zn_publish" href="#">
				<span class="zn_publish_loading"></span>
				<span class="zn_publish_text">PUBLISH</span>
			</a>
		</div>
	</div>

	<div class="zn_pb_tab_wrapper" class="fixclear">

		<div id="zn_pb_content" class="zn_pb_tab"></div>

		<?php 
/*
 *	HOOK INTO THE TABS
 */
do_action('znpb_editor_tabs_content');
?>


	</div>
	<input type="hidden" id="zn_post_id" value="<?php 
echo ZN()->pagebuilder->get_post_id();
?>
"/>
</div>
<div class="zn_page_loading"></div>
开发者ID:rock1media,项目名称:wordpress,代码行数:31,代码来源:editor.tpl.php

示例14: do_theme_activation

 function do_theme_activation()
 {
     $options_field = ZN()->theme_data['options_prefix'];
     $saved_values = array();
     //delete_option(  $options_field );
     // IF THE OPTIONS FIELD IS NOT PRESENT
     if (false === get_option($options_field)) {
         $file = THEME_BASE . "/template_helpers/dummy_content/theme_options.txt";
         if (!is_file($file)) {
             include THEME_BASE . '/template_helpers/options/theme-options.php';
             foreach ($admin_options as $key => $option) {
                 if (!empty($option['std'])) {
                     $saved_values[$option['parent']][$option['id']] = $option['std'];
                 } else {
                     $saved_values[$option['parent']][$option['id']] = '0';
                 }
             }
         } else {
             $data = file_get_contents($file);
             $saved_values = json_decode($data, true);
         }
         update_option($options_field, $saved_values);
         generate_options_css($saved_values);
         ZN()->pagebuilder->refresh_pb_data();
     }
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:26,代码来源:class-theme-setup.php

示例15: wp_enqueue_script

        wp_enqueue_script('jquery-ui-slider');
        // HTML
        wp_enqueue_script('jquery-ui-button');
        // HTML
        wp_enqueue_script('jquery-ui-sortable');
        // HTML + PB
        wp_enqueue_script('jquery-ui-datepicker');
        // HTML
        wp_enqueue_media();
        wp_enqueue_script('zn_timepicker', FW_URL . '/assets/js/jquery.timepicker.min.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_modal', FW_URL . '/assets/js/zn_modal.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_media', FW_URL . '/assets/js/zn_media.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_ace', FW_URL . '/assets/js/src-min-noconflict/ace.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('ZnFormHelper', FW_URL . '/assets/js/ZnFormHelper.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_html_script', FW_URL . '/assets/js/zn_html_script.js', array('jquery'), ZN_FW_VERSION, true);
        wp_localize_script('zn_html_script', 'ZnAjax', array('ajaxurl' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('zn_framework'), 'debug' => $this->theme_data['debug']));
    }
}
/**
 * Returns the main instance of WC to prevent the need to use globals.
 *
 * @since  1.0.0
 * @return Zn_Framework
 */
function ZN()
{
    return Zn_Framework::instance();
}
// Global for backwards compatibility.
$GLOBALS['zn_framework'] = ZN();
开发者ID:fjbeteiligung,项目名称:development,代码行数:30,代码来源:zn-framework.php


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