當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。