Пример #1
2
function kt_add_option_to_vc()
{
    $color_arr = array('vc_btn', 'vc_icon', 'vc_tta_accordion', 'vc_tta_tabs', 'vc_tta_tour');
    foreach ($color_arr as $item) {
        $button_colors = WPBMap::getParam($item, 'color');
        $button_colors['value'][esc_html__('Accent color', 'adroit')] = 'accent';
        vc_update_shortcode_param($item, $button_colors);
    }
    $background_arr = array('vc_icon');
    foreach ($background_arr as $item) {
        $button_colors = WPBMap::getParam($item, 'background_color');
        $button_colors['value'][esc_html__('Accent color', 'adroit')] = 'accent';
        vc_update_shortcode_param($item, $button_colors);
    }
    $image_styles = WPBMap::getParam('vc_single_image', 'style');
    $image_styles['value'][esc_html__('Border box', 'adroit')] = 'border-box';
    $image_styles['value'][esc_html__('Border box Left', 'adroit')] = 'border-left';
    $image_styles['value'][esc_html__('Border box Right', 'adroit')] = 'border-right';
    $image_styles['value'][esc_html__('Creative Left', 'adroit')] = 'creative-left';
    $image_styles['value'][esc_html__('Creative Right', 'adroit')] = 'creative-right';
    $image_styles['value'][esc_html__('Creative When hover', 'adroit')] = 'creative-hover';
    vc_update_shortcode_param('vc_single_image', $image_styles);
    $icon_btn = array('i_type', 'i_icon_fontawesome', 'i_icon_openiconic', 'i_icon_typicons', 'i_icon_entypo', 'i_icon_linecons', 'i_icon_pixelicons', 'css_animation', 'el_class');
    foreach ($icon_btn as $item) {
        vc_remove_param('vc_btn', $item);
    }
}
Пример #2
1
 public function form($instance)
 {
     $default = array('title' => '', 'number' => 2, 'is_show_date' => '', 'is_show_img' => '');
     $instance = wp_parse_args((array) $instance, $default);
     $yes_no_options = array('yes' => esc_html__('Yes', 'adventure-tours'), 'no' => esc_html__('No', 'adventure-tours'));
     echo '<p>' . '<label for="' . esc_attr($this->get_field_id('title')) . '">' . esc_html__('Title', 'adventure-tours') . ':</label>' . '<input class="widefat" id="' . esc_attr($this->get_field_id('title')) . '" name="' . esc_attr($this->get_field_name('title')) . '" type="text" value="' . esc_attr($instance['title']) . '">' . '</p>' . '<p>' . '<label for="' . esc_attr($this->get_field_id('number')) . '">' . esc_html__('Number of posts to show', 'adventure-tours') . ':</label>' . '<input id="' . esc_attr($this->get_field_id('number')) . '" name="' . esc_attr($this->get_field_name('number')) . '" type="text" value="' . esc_attr($instance['number']) . '" size="3">' . '</p>' . '<p>' . '<label for="' . esc_attr($this->get_field_id('is_show_date')) . '">' . esc_html__('Display post date?', 'adventure-tours') . '</label>' . '<select class="widefat" id="' . esc_attr($this->get_field_id('is_show_date')) . '" name="' . esc_attr($this->get_field_name('is_show_date')) . '">' . $this->render_options_html($yes_no_options, $instance['is_show_date']) . '</select>' . '</p>' . '<p>' . '<label for="' . esc_attr($this->get_field_id('is_show_img')) . '">' . esc_html__('Display post image?', 'adventure-tours') . '</label>' . '<select class="widefat" id="' . esc_attr($this->get_field_id('is_show_img')) . '" name="' . esc_attr($this->get_field_name('is_show_img')) . '">' . $this->render_options_html($yes_no_options, $instance['is_show_img']) . '</select>' . '</p>';
 }
 /**
  * Hook into queries, admin screens, and more!
  *
  * @since 0.1.2
  */
 public function __construct($file = '')
 {
     // Setup the labels
     $this->labels = array('singular' => esc_html__('Visibility', 'wp-term-color'), 'plural' => esc_html__('Visibilities', 'wp-term-color'), 'description' => esc_html__('The visibiilty is used to restrict specific terms to specific users.', 'wp-term-color'));
     // Call the parent and pass the file
     parent::__construct($file);
 }
/**
 * Adds the resource meta boxes.
 */
function add_team_member_meta_boxes()
{
    if (!is_admin()) {
        return;
    }
    add_meta_box('fz_team_member_meta_box', esc_html__('Team Member Profile Info', 'fzp'), __NAMESPACE__ . '\\display_team_member_meta_box', get_team_members_post_type_name(), 'normal', 'default');
}
Пример #5
0
    public function form($instance)
    {
        if (isset($instance['title'])) {
            $title = $instance['title'];
        } else {
            $title = esc_html__('Site Links', 'wise-blog');
        }
        // Backend Admin Form
        ?>
<p>
<label for="<?php 
        echo esc_attr($this->get_field_id('title'));
        ?>
"><?php 
        esc_html_e('Title:', 'wise-blog');
        ?>
</label> 
<input class="widefat" id="<?php 
        echo esc_attr($this->get_field_id('title'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('title'));
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
">
</p>

<?php 
    }
/**
 * Show cart link and quantity count in header if the cart has contents.
 *
 * The ".edd-cart-quantity" class is needed in order for the quantity to be
 * updated dynamically via AJAX.
 *
 * @todo  Add cart link to mobile navigation bar.
 *
 * @since 1.0.0
 */
function huesos_edd_show_header_cart_link()
{
    if (!edd_get_cart_contents()) {
        return;
    }
    printf('<p class="cart-quantity"><a class="button" href="%1$s">%2$s (<span class="edd-cart-quantity">%3$s</span>)</a></p>', esc_url(edd_get_checkout_uri()), esc_html__('Cart', 'huesos'), esc_html(edd_get_cart_quantity()));
}
Пример #7
0
/**
 * Adds the style meta box.
 *
 * @since  1.0.0
 * @access public
 * @param  string  $post_type
 * @param  object  $post
 * @return void
 */
function carelib_metabox_post_styles_add($post_type, $post)
{
    $styles = carelib_get_post_styles($post_type);
    if (!empty($styles) && current_user_can('edit_theme_options')) {
        add_meta_box('carelib-post-style', esc_html__('Style', 'carelib'), 'carelib_metabox_post_styles_box', $post_type, 'side', 'default');
    }
}
Пример #8
0
function barcelona_enqueue_scripts()
{
    wp_enqueue_script('jquery');
    if (!is_admin()) {
        $barcelona_post_id = NULL;
        if (is_singular()) {
            global $post;
            $barcelona_post_id = $post->ID;
        }
        /*
         * Enqueue Styles
         */
        $barcelona_font = barcelona_get_font();
        wp_register_style('barcelona-font', esc_url($barcelona_font[0]));
        wp_enqueue_style('barcelona-font');
        wp_register_style('bootstrap', BARCELONA_THEME_PATH . 'assets/css/bootstrap.min.css', array(), '3.3.4');
        wp_enqueue_style('bootstrap');
        wp_register_style('font-awesome', BARCELONA_THEME_PATH . 'assets/css/font-awesome.min.css', array(), '4.4.0');
        wp_enqueue_style('font-awesome');
        wp_register_style('vs-preloader', BARCELONA_THEME_PATH . 'assets/css/vspreloader.min.css');
        wp_enqueue_style('vs-preloader');
        wp_register_style('owl-carousel', BARCELONA_THEME_PATH . 'assets/lib/owl-carousel/assets/owl.carousel.min.css', array(), '2.0.0');
        wp_enqueue_style('owl-carousel');
        wp_register_style('owl-theme', BARCELONA_THEME_PATH . 'assets/lib/owl-carousel/assets/owl.theme.default.min.css', array(), '2.0.0');
        wp_enqueue_style('owl-theme');
        wp_register_style('jquery-boxer', BARCELONA_THEME_PATH . 'assets/css/jquery.fs.boxer.min.css', array(), '3.3.0');
        wp_enqueue_style('jquery-boxer');
        wp_register_style('barcelona-stylesheet', BARCELONA_THEME_PATH . 'style.css', array(), BARCELONA_THEME_VERSION);
        wp_enqueue_style('barcelona-stylesheet');
        if (is_rtl()) {
            wp_register_style('barcelona-rtl', BARCELONA_THEME_PATH . 'assets/css/barcelona-rtl.css', array(), BARCELONA_THEME_VERSION);
            wp_enqueue_style('barcelona-rtl');
        }
        /*
         * Enqueue Scripts
         */
        wp_register_script('ie-html5', BARCELONA_THEME_PATH . 'assets/js/html5.js');
        wp_enqueue_script('ie-html5');
        wp_register_script('bootstrap', BARCELONA_THEME_PATH . 'assets/js/bootstrap.min.js', array('jquery'), '3.3.4', true);
        wp_enqueue_script('bootstrap');
        wp_register_script('retina-js', BARCELONA_THEME_PATH . 'assets/js/retina.min.js');
        wp_enqueue_script('retina-js');
        wp_register_script('picturefill', BARCELONA_THEME_PATH . 'assets/js/picturefill.min.js', array(), false, true);
        wp_enqueue_script('picturefill');
        wp_register_script('owl-carousel', BARCELONA_THEME_PATH . 'assets/lib/owl-carousel/owl.carousel.min.js', array('jquery'), '2.0.0', true);
        wp_enqueue_script('owl-carousel');
        wp_register_script('boxer', BARCELONA_THEME_PATH . 'assets/js/jquery.fs.boxer.min.js', array('jquery'), '3.3.0', true);
        wp_enqueue_script('boxer');
        if (is_active_widget(false, false, 'barcelona-gplus-box')) {
            wp_register_script('google-platform', esc_url('//apis.google.com/js/platform.js'), false, true);
            wp_enqueue_script('google-platform');
        }
        if (is_singular() && comments_open() && get_option('thread_comments')) {
            wp_enqueue_script('comment-reply');
        }
        wp_register_script('barcelona-main', BARCELONA_THEME_PATH . 'assets/js/barcelona-main.js', array('jquery'), BARCELONA_THEME_VERSION, true);
        wp_enqueue_script('barcelona-main');
        wp_localize_script('barcelona-main', 'barcelonaParams', array('ajaxurl' => esc_url(admin_url('admin-ajax.php')), 'post_id' => $barcelona_post_id, 'i18n' => array('login_to_vote' => esc_html__('Please login to vote!', 'barcelona'))));
    }
}
/**
 * Display Upgrade Notices.
 *
 * @since 2.0
 * @return void
 */
function gmb_show_upgrade_notices()
{
    // Don't show notices on the upgrades page.
    if (isset($_GET['page']) && $_GET['page'] == 'gmb-upgrades') {
        return;
    }
    //Check to see if we have any posts.
    $gmb_posts = get_posts(array('post_type' => 'google_maps', 'posts_per_page' => 10));
    if (empty($gmb_posts)) {
        update_option('gmb_refid_upgraded', 'upgraded');
        //mark as updated.
        return;
        //Don't run if there's no posts!
    }
    $gmb_version = get_option('gmb_version');
    if (!$gmb_version) {
        // 2.0 is the first version to use this option so we must add it.
        $gmb_version = '2.0';
    }
    update_option('gmb_version', GMB_VERSION);
    $gmb_version = preg_replace('/[^0-9.].*/', '', $gmb_version);
    if (version_compare($gmb_version, '2.0', '<=') && !get_option('gmb_refid_upgraded')) {
        printf('<div class="updated"><p><strong>' . __('Maps Builder Update Required', 'google-maps-builder') . ':</strong> ' . esc_html__('Google has updated their Maps API to use the new Google Places ID rather than previous Reference ID. The old method will soon be deprecated and eventually go offline. We are being proactive and would like to update your maps to use the new Places ID. Once you upgrade, your maps should work just fine but remember to make a backup prior to upgrading. If you choose not to upgrade Google will eventually take the old reference ID offline (no date has been given). Please contact WordImpress support via our website if you have any further questions or issues. %sClick here to upgrade your maps to use the new Places ID%s', 'google-maps-builder') . '</p></div>', '<br><a href="' . esc_url(admin_url('options.php?page=gmb-upgrades')) . '" class="button button-primary" style="margin-top:10px;">', '</a>');
    } elseif (version_compare($gmb_version, '2.1', '<=') && !gmb_has_upgrade_completed('gmb_markers_upgraded')) {
        printf('<div class="updated"><p><strong>' . __('Maps Builder Update Required', 'google-maps-builder') . ':</strong> ' . esc_html__('An upgrade is required to update your Google maps with the latest plugin version. Please perform a site backup and then upgrade. %sClick here to upgrade your maps%s', 'google-maps-builder') . '</p></div>', '<br><a href="' . esc_url(admin_url('options.php?page=gmb-upgrades')) . '" class="button button-primary" style="margin-top:10px;">', '</a>');
    }
}
Пример #10
0
/**
 * Load plugin if possible
 *
 * @since 0.0.0
 */
function ingot_maybe_load()
{
    $fail = false;
    if (!version_compare(PHP_VERSION, '5.5.0', '>=')) {
        $fail = true;
        if (is_admin()) {
            include_once dirname(__FILE__) . '/vendor/calderawp/dismissible-notice/src/functions.php';
            $message = esc_html__(sprintf('Ingot requires PHP version 5.5.0 or later. Current version is %s.', PHP_VERSION), 'ingot');
            if (function_exists('caldera_warnings_dismissible_notice')) {
                echo caldera_warnings_dismissible_notice($message, true, 'activate_plugins');
            }
        }
    }
    global $wp_version;
    if (!version_compare($wp_version, '4.4', '>=')) {
        $fail = true;
        if (is_admin()) {
            include_once dirname(__FILE__) . '/vendor/calderawp/dismissible-notice/src/functions.php';
            $message = esc_html__(sprintf('Ingot requires WordPress version 4.4 or later. Current version is %s.', $wp_version), 'ingot');
            echo caldera_warnings_dismissible_notice($message, true, 'activate_plugins');
        }
    }
    if (false == $fail) {
        include_once dirname(__FILE__) . '/ingot_bootstrap.php';
        add_action('plugins_loaded', array('ingot_bootstrap', 'maybe_load'));
    }
}
Пример #11
0
 function __construct()
 {
     //load text domains
     GFCommon::load_gf_text_domain('gravityforms');
     $description = esc_html__('Gravity Forms Widget', 'gravityforms');
     WP_Widget::__construct('gform_widget', __('Form', 'gravityforms'), array('classname' => 'gform_widget', 'description' => $description), array('width' => 200, 'height' => 250, 'id_base' => 'gform_widget'));
 }
 function setUp()
 {
     parent::setUp();
     self::$instance = new Publishing_Checklist();
     $args = array('label' => esc_html__('Word Count', 'publishing-checklist'), 'callback' => 'ensure_minimum_200_words', 'explanation' => esc_html__('Posts should be at least 200 words.', 'publishing-checklist'), 'post_type' => array('post'));
     Publishing_Checklist()->register_task('test-publishing-checklist-word-count', $args);
 }
Пример #13
0
 /**
  * Hook into queries, admin screens, and more!
  *
  * @since 0.1.0
  */
 public function __construct($file = '')
 {
     // Setup the labels
     $this->labels = array('singular' => esc_html__('Family', 'wp-term-families'), 'plural' => esc_html__('Families', 'wp-term-families'), 'description' => esc_html__('The family is used to group terms together using another taxonomy.', 'wp-term-families'));
     // Call the parent and pass the file
     parent::__construct($file);
 }
 /**
  * Register customizer sections.
  *
  * Add sections to the WordPress customizer.
  *
  * @since 1.0.0
  * @param array $wp_customize Array with all customizer data.
  */
 function polygon_register_customizer_sections($wp_customize)
 {
     if (!isset($wp_customize)) {
         return;
     }
     /*
      * Example Settings section
      *
      * This section contains all the parameters you can use when creating a new
      * customizer section.
      */
     $wp_customize->add_section('example_settings_section', array('title' => esc_html__('Example Settings', 'polygon'), 'description' => esc_html__('This is an example section you can use as a starting point for new customizer sections.'), 'panel' => 'example_panel', 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => 'polygon-portfolio', 'active_callback' => 'active_callback_function'));
     /*
      * Basic Settings section
      *
      * This is an aditional section registered using only the required parameters.
      * Use it to contain basic settings / controls.
      */
     $wp_customize->add_section('basic_settings_section', array('title' => esc_html__('Basic Settings', 'polygon'), 'panel' => 'example_panel'));
     /*
      * Advanced Settings section
      *
      * This is an aditional section registered using only the required parameters.
      * Use it to contain advanced or custom settings / controls.
      */
     $wp_customize->add_section('advanced_settings_section', array('title' => esc_html__('Advanced Settings', 'polygon'), 'panel' => 'example_panel'));
     /*
      * Register sections from partials
      *
      * Register customizer sections from external files.
      */
     polygon_customizer_add_sections('example');
     polygon_customizer_add_sections('layout');
 }
Пример #15
0
function document_title($title = '', $sep = '-', $seplocation = 'right')
{
    // Remove default seperator and add spacing
    if (trim($sep) === '' || $sep === '&raquo;' || $sep === '&#187;') {
        $sep = '-';
    }
    $sep = ' ' . $sep . ' ';
    // Determine page number, if any
    $page_num = '';
    if (is_paged()) {
        global $page, $paged;
        if ($paged >= 2 || $page >= 2) {
            $page_num = $sep . sprintf(esc_html__('Page %d', 'ubik'), max($paged, $page));
        }
    }
    // Generate the title using our all-purpose title function
    $title = apply_filters('ubik_seo_document_title_raw', ubik_title());
    $name = get_bloginfo('name');
    $desc = get_bloginfo('description');
    // Handle three scenarios: home/front page, archive feeds, and everything else
    if (is_front_page() || is_home()) {
        $title = $name;
        if (!empty($desc) && !is_paged()) {
            $title .= $sep . $desc;
        }
    } elseif (is_feed() && is_archive()) {
        $title = $sep . $title;
        // Adding the separator alters the default archive feed title output
    } else {
        $title = $title . $sep . $name;
    }
    // Sanitize and add page number as needed
    $title = esc_html(strip_tags(stripslashes(preg_replace('/\\s+/', ' ', trim($title . $page_num)))));
    return apply_filters('ubik_seo_document_title_final', $title);
}
 function column_date($post)
 {
     $html = '';
     if ('0000-00-00 00:00:00' == $post->post_date) {
         $t_time = $h_time = __('Unpublished', 'jetpack');
         $time_diff = 0;
     } else {
         $t_time = date(__('Y/m/d g:i:s A', 'jetpack'), mysql2date('G', $post->post_date));
         $m_time = $post->post_date;
         $time = get_post_time('G', true, $post);
         $time_diff = time() - $time;
         if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) {
             $h_time = sprintf(__('%s ago', 'jetpack'), human_time_diff($time));
         } else {
             $h_time = mysql2date(__('Y/m/d', 'jetpack'), $m_time);
         }
     }
     $html .= '<abbr title="' . esc_attr($t_time) . '">' . esc_html($h_time) . '</abbr>';
     $html .= '<br />';
     if ('publish' == $post->post_status) {
         $html .= esc_html__('Published', 'jetpack');
     } elseif ('future' == $post->post_status) {
         if ($time_diff > 0) {
             $html .= '<strong class="attention">' . esc_html__('Missed schedule', 'jetpack') . '</strong>';
         } else {
             $html .= esc_html__('Scheduled', 'jetpack');
         }
     } else {
         $html .= esc_html__('Last Modified', 'jetpack');
     }
     return $html;
 }
Пример #17
0
/**
 * Add contextual help
 *
 * @since 0.2.0
 */
function wp_user_profiles_add_contextual_help()
{
    // Static sidebar
    get_current_screen()->set_help_sidebar('<p>' . esc_html__('Some information may be displayed publicly on the site.', 'wp-user-profiles') . '</p>' . '<p>' . esc_html__('Always use a strong password, and never give your login information to anyone.', 'wp-user-profiles') . '</p>');
    // Allow plugins to easily hook in
    do_action('wp_user_profiles_add_contextual_help');
}
Пример #18
0
	function  Widget_Class_Name_Widget(){

		/* Check if Hybrid-core framework is active */
		if( class_exists( 'Hybrid' ) ){
			/* Set the widget prefix */
			$this->prefix = hybrid_get_prefix();
			
			/* Set the widget textdomain. */
			$this->textdomain = hybrid_get_parent_textdomain();
		} else {
			$this->prefix = 'prefix';
			$this->textdomain = 'prefix';
		}
		
		$this->widget_id = 'widget-id';
		
		$widget_options = array(
						'classname' => "{$this->prefix}-{$this->widget_id}",
						'description' => esc_html__( 'Description of the widget', $this->textdomain )
					);
		
		$control_options = array(
						'height' => '300',
						'width' => '240',
						'id_base' => "{$this->prefix}-{$this->widget_id}"
					);
		
		$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Widget Name', $this->textdomain ), $widget_options, $control_options );
		
	}
Пример #19
0
function slicetheme_team_metaboxes(array $meta_boxes)
{
    // Start with an underscore to hide fields from custom fields list
    $prefix = '_st_team_';
    $meta_boxes[] = array('id' => 'team_metabox', 'title' => 'Team Attributes', 'pages' => array('st_team'), 'context' => 'normal', 'priority' => 'default', 'show_names' => true, 'fields' => array(array('name' => esc_html__('Position', 'slicetheme'), 'desc' => esc_html__('Enter position name in your company.', 'slicetheme'), 'id' => $prefix . 'position', 'type' => 'text_medium'), array('name' => esc_html__('Phone', 'slicetheme'), 'desc' => '', 'id' => $prefix . 'phone', 'type' => 'text_medium'), array('name' => esc_html__('Fax', 'slicetheme'), 'desc' => '', 'id' => $prefix . 'fax', 'type' => 'text_medium'), array('name' => esc_html__('Email Address', 'slicetheme'), 'desc' => '', 'id' => $prefix . 'email', 'type' => 'text_medium'), array('name' => esc_html__('Social Icons', 'slicetheme'), 'desc' => '', 'id' => $prefix . 'social', 'type' => 'st_social_icons')));
    return $meta_boxes;
}
Пример #20
0
/**
 * Initializes all the theme settings page functionality. This function is used to create the theme settings 
 * page, then use that as a launchpad for specific actions that need to be tied to the settings page.
 *
 * @since 0.7.0
 * @global string $hybrid The global theme object.
 * @return void
 */
function hybrid_settings_page_init()
{
    global $hybrid;
    /* Get theme information. */
    $theme = wp_get_theme(get_template(), get_theme_root(get_template_directory()));
    $prefix = hybrid_get_prefix();
    /* Register theme settings. */
    register_setting("{$prefix}_theme_settings", "{$prefix}_theme_settings", 'hybrid_save_theme_settings');
    /* Create the theme settings page. */
    $hybrid->settings_page = add_theme_page(sprintf(esc_html__('%s Theme Settings', 'hybrid-core'), $theme->get('Name')), esc_html__('Theme Settings', 'hybrid-core'), hybrid_settings_page_capability(), 'theme-settings', 'hybrid_settings_page');
    /* Check if the settings page is being shown before running any functions for it. */
    if (!empty($hybrid->settings_page)) {
        /* Filter the settings page capability so that it recognizes the 'edit_theme_options' cap. */
        add_filter("option_page_capability_{$prefix}_theme_settings", 'hybrid_settings_page_capability');
        /* Add help tabs to the theme settings page. */
        add_action("load-{$hybrid->settings_page}", 'hybrid_settings_page_help');
        /* Load the theme settings meta boxes. */
        add_action("load-{$hybrid->settings_page}", 'hybrid_load_settings_page_meta_boxes');
        /* Create a hook for adding meta boxes. */
        add_action("load-{$hybrid->settings_page}", 'hybrid_settings_page_add_meta_boxes');
        /* Load the JavaScript and stylesheets needed for the theme settings screen. */
        add_action('admin_enqueue_scripts', 'hybrid_settings_page_enqueue_scripts');
        add_action('admin_enqueue_scripts', 'hybrid_settings_page_enqueue_styles');
        add_action("admin_footer-{$hybrid->settings_page}", 'hybrid_settings_page_load_scripts');
    }
}
    public function form($instance)
    {
        // Setting Default widget title if not set
        $title = !empty($instance['title']) ? $instance['title'] : esc_html__('Tags', 'carolina');
        ?>

        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        echo esc_html__('Title:', 'carolina');
        ?>
</label>
            <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
">
        </p>
        <?php 
    }
 /**
  * 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.
  */
 function _act_setup()
 {
     load_theme_textdomain('_s', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     add_theme_support('title-tag');
     /*
      * 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');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => esc_html__('Primary', '_act'), 'hero' => esc_html__('Hero', '_act')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     /*
      * Enable support for Post Formats.
      * See https://developer.wordpress.org/themes/functionality/post-formats/
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // Set up the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('_act_custom_background_args', array('default-color' => 'ffffff', 'default-image' => '')));
     add_image_size('feature500', 500, 500, true);
 }
Пример #23
0
 public function save()
 {
     if (!$this->validate()) {
         return new \WP_Error('validation-error', esc_html__('Could not validate record data.', 'stream'));
     }
     return wp_stream_get_instance()->db->insert((array) $this);
 }
 function __construct()
 {
     $this->label = esc_html__('List', 'gravityview');
     parent::__construct();
     add_filter('gravityview/template/field_label', array($this, '_filter_field_label'), 10, 4);
     add_filter('gravityview/common/get_form_fields', array($this, 'add_form_fields'), 10, 3);
 }
Пример #25
0
/**
* Cultiv8 Theme Customizer
*
* @package Cultiv8
*/
function cultiv8_customize_register($wp_customize)
{
    // Site Logo functionality if Jetpack is not installed or WP4.5 which has site logo built in
    if (!function_exists('the_custom_logo') && !function_exists('jetpack_the_site_logo')) {
        $wp_customize->get_section('title_tagline')->title = __('Site Title, Tagline, and Logo', 'cultiv8');
        $wp_customize->add_setting('cultiv8_site_logo', array('default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage'));
        $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'cultiv8_site_logo', array('label' => esc_html__('Site Logo', 'cultiv8'), 'section' => 'title_tagline', 'settings' => 'cultiv8_site_logo', 'description' => sprintf(__('The Site Logo is displayed in the header. Uncheck <code>%s</code> to display only the logo. ', 'cultiv8'), __('Display Header Text')))));
    }
    // Podcasting options
    cultiv8_customize_createSection($wp_customize, array('id' => 'podcast', 'title' => _x('Podcasting', 'Customizer section title', 'cultiv8'), 'description' => _x('Settings for audio podcast', 'Customizer section description', 'cultiv8')));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_desc', 'label' => _x('Podcast Description', 'Customizer setting', 'cutiv8'), 'type' => 'textarea', 'default' => get_bloginfo('description'), 'section' => 'podcast'));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_author', 'label' => _x('Podcast Author', 'Customizer setting', 'cultiv8'), 'type' => 'text', 'default' => get_bloginfo('name'), 'section' => 'podcast'));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_logo', 'label' => _x('Podcast Logo', 'Customizer setting', 'cultiv8'), 'type' => 'image', 'default' => '', 'section' => 'podcast', 'description' => _x('Logo used in podcast feed. Must be 1400 x 1400 jpg or png.', 'Podcast logo option description', 'cultiv8')));
    // RSS
    cultiv8_customize_createSection($wp_customize, array('id' => 'rss', 'title' => _x('RSS Options', 'Customizer section title', 'cultiv8'), 'description' => _x('Settings for RSS feed', 'Customizer section description', 'cultiv8')));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_feed_logo', 'label' => _x('RSS feed Logo', 'Customizer setting', 'cultiv8'), 'type' => 'image', 'default' => '', 'section' => 'rss', 'description' => _x('Logo used in RSS feed. Sometimes a white + transparent logo does not show well in RSS readers. Use this to display a different logo than your site logo.', 'RSS feed logo option description', 'cultiv8')));
    // Panel options
    $panels = 12;
    // New panels
    for ($i = 9; $i <= $panels; $i++) {
        $wp_customize->add_section('pique_panel' . $i, array('title' => esc_html__('Panel ' . $i, 'pique'), 'active_callback' => 'is_front_page', 'panel' => 'pique_options_panel', 'description' => __('Add a background image to your panel by setting a featured image in the page editor. If you don&rsquo;t select a page, this panel will not be displayed.', 'pique')));
        $wp_customize->add_setting('pique_panel' . $i, array('default' => false, 'sanitize_callback' => 'pique_sanitize_numeric_value'));
        $wp_customize->add_control('pique_panel' . $i, array('label' => esc_html__('Panel Content', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'dropdown-pages'));
        $wp_customize->add_setting('pique_panel' . $i . '_background', array('default' => 'default', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
        $wp_customize->add_control('pique_panel' . $i . '_background', array('label' => esc_html__('Background Color', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'color'));
        $wp_customize->add_setting('pique_panel' . $i . '_opacity', array('default' => 'default', 'sanitize_callback' => 'pique_sanitize_opacity', 'transport' => 'postMessage'));
        $wp_customize->add_control('pique_panel' . $i . '_opacity', array('label' => esc_html__('Featured Image Opacity', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'select', 'description' => esc_html('Set the opacity of the featured image over the panel background.', 'pique'), 'choices' => array('0.25' => esc_html__('25%', 'pique'), '0.5' => esc_html__('50%', 'pique'), '0.75' => esc_html__('75%', 'pique'), '1' => esc_html__('100%', 'pique'))));
    }
    for ($i = 1; $i <= $panels; $i++) {
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_hidetitle', 'label' => _x('Hide Title', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'transport' => 'postMessage', 'description' => __('Check to hide the title in this section', 'cultiv8')));
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_height', 'label' => _x('Auto height', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'transport' => 'postMessage', 'description' => __('Check to adjust panel height to content', 'cultiv8')));
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_hideinmenu', 'label' => _x('Hide from Menu', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'description' => __('Check to hide this pane from the top menu if the <code>Add an anchor menu to the front page</code> option is selected.', 'cultiv8')));
    }
}
Пример #26
0
/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */
function janes_ent_widgets_init()
{
    register_sidebar(array('name' => esc_html__('Sidebar', 'janes-ent'), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => esc_html__('Footer Sidebar 1', 'janes-ent'), 'id' => 'footer-sidebar-1', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => esc_html__('Footer Sidebar 2', 'janes-ent'), 'id' => 'footer-sidebar-2', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
    register_sidebar(array('name' => esc_html__('Footer Sidebar 3', 'janes-ent'), 'id' => 'footer-sidebar-3', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
}
Пример #27
0
/**
 * Filter sections and add "Events" section
 *
 * @since 0.3.0
 *
 * @param array $sections
 */
function wp_event_calendar_add_section($sections = array())
{
    // Events
    $sections[] = array('id' => 'events', 'slug' => 'events', 'url' => '', 'label' => esc_html__('Events', 'wp-user-alerts'), 'show_in_menu' => true, 'order' => 20);
    // Return sections
    return $sections;
}
Пример #28
0
function carolina_meta_boxes()
{
    $carolina_home_meta_box = array('id' => 'home_meta_box', 'title' => esc_html__('Home Page Options', 'carolina'), 'desc' => '', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => esc_html__('Heading', 'carolina'), 'id' => 'featured_recipe', 'type' => 'tab'), array('id' => 'site_carolina_home_title', 'label' => esc_html__('Enter the title of the Page', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_home_description', 'label' => esc_html__('Enter the description of the Page', 'carolina'), 'type' => 'textarea-simple'), array('label' => esc_html__('Slider Section', 'carolina'), 'id' => 'slider_section', 'type' => 'tab'), array('id' => 'site_home_slider_categories', 'label' => esc_html__('Select the categories of the posts to be displayed in the slider', 'carolina'), 'desc' => '', 'std' => '', 'type' => 'category-select', 'class' => ''), array('id' => 'site_home_slider_no', 'label' => esc_html__('Select the number of images to be displayed in the slider', 'carolina'), 'desc' => '', 'std' => '3', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('1', 'carolina'), 'value' => '1'), array('label' => esc_html__('2', 'carolina'), 'value' => '2'), array('label' => esc_html__('3', 'carolina'), 'value' => '3'), array('label' => esc_html__('4', 'carolina'), 'value' => '4'), array('label' => esc_html__('5', 'carolina'), 'value' => '5'), array('label' => esc_html__('6', 'carolina'), 'value' => '6'), array('label' => esc_html__('7', 'carolina'), 'value' => '7'), array('label' => esc_html__('8', 'carolina'), 'value' => '8'), array('label' => esc_html__('9', 'carolina'), 'value' => '9'), array('label' => esc_html__('10', 'danfe'), 'value' => '10'))), array('label' => esc_html__('Featured Recipe', 'carolina'), 'id' => 'home_featured_recipe', 'type' => 'tab'), array('id' => 'home_featured_recipe_post_no', 'label' => esc_html__('Select the number of featured recipe to display', 'carolina'), 'desc' => '', 'std' => '6', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('1', 'carolina'), 'value' => '1'), array('label' => esc_html__('2', 'carolina'), 'value' => '2'), array('label' => esc_html__('3', 'carolina'), 'value' => '3'), array('label' => esc_html__('4', 'carolina'), 'value' => '4'), array('label' => esc_html__('5', 'carolina'), 'value' => '5'), array('label' => esc_html__('6', 'carolina'), 'value' => '6'))), array('label' => esc_html__('Post', 'carolina'), 'id' => 'home_post', 'type' => 'tab'), array('id' => 'home_post_no', 'label' => esc_html__('Select the number of posts to display', 'carolina'), 'desc' => '', 'std' => '6', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('All', 'carolina'), 'value' => '-1'), array('label' => esc_html__('1', 'carolina'), 'value' => '1'), array('label' => esc_html__('2', 'carolina'), 'value' => '2'), array('label' => esc_html__('3', 'carolina'), 'value' => '3'), array('label' => esc_html__('4', 'carolina'), 'value' => '4'), array('label' => esc_html__('5', 'carolina'), 'value' => '5'), array('label' => esc_html__('6', 'carolina'), 'value' => '6')))));
    $carolina_about_meta_box = array('id' => 'blog_meta_box', 'title' => esc_html__('Options', 'carolina'), 'desc' => '', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => esc_html__('Title', 'carolina'), 'id' => 'carolina_about_display', 'type' => 'tab'), array('id' => 'site_carolina_about_title', 'label' => esc_html__('Short Title', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_about_description', 'label' => esc_html__('Short Description', 'carolina'), 'type' => 'textarea-simple'), array('id' => 'site_carolina_about_content_title', 'label' => esc_html__('Heading', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_about_first_section', 'label' => esc_html__('First Section', 'carolina'), 'type' => 'tab'), array('id' => 'site_carolina_about_content_first_section', 'label' => esc_html__('Content', 'carolina'), 'type' => 'Textarea'), array('id' => 'site_carolina_about_second_section', 'label' => esc_html__('Second Section', 'carolina'), 'type' => 'tab'), array('id' => 'site_carolina_about_content_second_section', 'label' => esc_html__('Content', 'carolina'), 'type' => 'list-item', 'settings' => array(array('id' => 'second_section_icons', 'label' => esc_html__('Icons', 'carolina'), 'type' => 'upload'), array('id' => 'second_section_description', 'label' => esc_html__('Short description', 'carolina'), 'type' => 'Textarea'))), array('id' => 'site_carolina_about_third_section', 'label' => esc_html__('Third Section', 'carolina'), 'type' => 'tab'), array('id' => 'site_carolina_about_content_third_section', 'label' => esc_html__('Content', 'carolina'), 'type' => 'Textarea'), array('label' => esc_html__('Sidebar', 'carolina'), 'id' => 'carolina_about_option', 'type' => 'tab'), array('id' => 'site_about_option', 'label' => esc_html__('Enable Global Settings', 'carolina'), 'desc' => '', 'std' => 'yes', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_about_sidebar_option', 'label' => esc_html__('Disable Sidebar', 'carolina'), 'desc' => '', 'std' => 'no', 'type' => 'radio', 'class' => '', 'section' => 'archive_page', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_about_sidebar_name', 'label' => esc_html__('Sidebar Name', 'carolina'), 'desc' => '', 'std' => 'sidebar', 'type' => 'sidebar-select', 'class' => '', 'section' => 'archive_page'), array('id' => 'site_about_sidebar_position', 'label' => esc_html__('Sidebar Position', 'carolina'), 'desc' => '', 'std' => 'right', 'type' => 'select', 'section' => 'archive_page', 'class' => '', 'choices' => array(array('label' => esc_html__('Left', 'carolina'), 'value' => 'left'), array('label' => esc_html__('Right', 'carolina'), 'value' => 'right')))));
    $carolina_recipe_meta_box = array('id' => 'recipe_meta_box', 'title' => esc_html__('Options', 'carolina'), 'desc' => '', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => esc_html__('Heading', 'carolina'), 'id' => 'carolina_recipe_display', 'type' => 'tab'), array('id' => 'site_carolina_recipe_title', 'label' => esc_html__('Enter the title for the Recipe Page', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_recipe_description', 'label' => esc_html__('Enter the description for the Recipe Page', 'carolina'), 'type' => 'textarea-simple'), array('id' => 'site_carolina_recipe_heading', 'label' => esc_html__('Enter the heading for the Recipe Section ', 'carolina'), 'type' => 'text'), array('label' => esc_html__('Post', 'carolina'), 'id' => 'carolina_recipe_post', 'type' => 'tab'), array('id' => 'site_carolina_recipe_post_no', 'label' => esc_html__('Enter the number of posts to display', 'carolina'), 'type' => 'select', 'std' => '-1', 'choices' => array(array('label' => esc_html__('All', 'carolina'), 'value' => '-1'), array('label' => esc_html__('1', 'carolina'), 'value' => '1'), array('label' => esc_html__('2', 'carolina'), 'value' => '2'), array('label' => esc_html__('3', 'carolina'), 'value' => '3'), array('label' => esc_html__('4', 'carolina'), 'value' => '4'), array('label' => esc_html__('5', 'carolina'), 'value' => '5'), array('label' => esc_html__('6', 'carolina'), 'value' => '6'), array('label' => esc_html__('7', 'carolina'), 'value' => '7'), array('label' => esc_html__('8', 'carolina'), 'value' => '8'), array('label' => esc_html__('9', 'carolina'), 'value' => '9'), array('label' => esc_html__('10', 'carolina'), 'value' => '10'))), array('label' => esc_html__('Sidebar', 'carolina'), 'id' => 'carolina_recipe_option', 'type' => 'tab'), array('id' => 'site_recipe_global_option', 'label' => esc_html__('Enable Global Settings', 'carolina'), 'desc' => '', 'std' => 'yes', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_recipe_sidebar_option', 'label' => esc_html__('Disable Sidebar', 'carolina'), 'desc' => '', 'std' => 'no', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_recipe_sidebar_name', 'label' => esc_html__('Sidebar Name', 'carolina'), 'desc' => '', 'std' => 'sidebar-select', 'type' => 'select', 'class' => ''), array('id' => 'site_recipe_sidebar_position', 'label' => esc_html__('Sidebar Position', 'carolina'), 'desc' => '', 'std' => 'right', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('Left', 'carolina'), 'value' => 'left'), array('label' => esc_html__('Right', 'carolina'), 'value' => 'right')))));
    $carolina_contact_meta_box = array('id' => 'carolina_contact_meta_box', 'title' => esc_html__('Contact Page Option', 'carolina'), 'desc' => '', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => esc_html__('Title', 'carolina'), 'id' => 'carolina_contact_title', 'type' => 'tab'), array('id' => 'site_carolina_contact_title', 'label' => esc_html__('Enter the title for the Contact Page', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_contact_description', 'label' => esc_html__('Enter the description for the Contact Page', 'carolina'), 'type' => 'textarea-simple'), array('id' => 'site_carolina_contact_heading', 'label' => esc_html__('Enter the heading for the Location section', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_contact_comment_heading', 'label' => esc_html__('Enter the heading for the comment-form', 'carolina'), 'type' => 'text'), array('label' => esc_html__('Location', 'carolina'), 'id' => 'carolina_contact_location', 'type' => 'tab'), array('id' => 'site_content_contact_location', 'label' => esc_html__('Location', 'carolina'), 'desc' => esc_html__('Enter the address of the company', 'carolina'), 'std' => '', 'type' => 'textarea', 'class' => ''), array('id' => 'site_content_contact_ph', 'label' => esc_html__('Contact Number', 'carolina'), 'desc' => esc_html__('Enter the contact number of the company', 'carolina'), 'std' => '', 'type' => 'textarea', 'class' => ''), array('label' => esc_html__('Contact Form', 'carolina'), 'id' => 'carolina_contact_form', 'type' => 'tab'), array('id' => 'carolina_contact_form_content', 'label' => esc_html__('Please Enter the shortcode of the contact form', 'carolina'), 'type' => 'textarea-simple'), array('label' => esc_html__('Sidebar', 'carolina'), 'id' => 'carolina_contact_option', 'type' => 'tab'), array('id' => 'carolina_contact_global_option', 'label' => esc_html__('Enable Global Settings', 'carolina'), 'desc' => '', 'std' => 'yes', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'carolina_contact_sidebar_option', 'label' => esc_html__('Disable Sidebar', 'carolina'), 'desc' => '', 'std' => 'no', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no')), 'condition' => 'carolina_contact_global_option:is(no)'), array('id' => 'site_contact_sidebar_name', 'label' => esc_html__('Sidebar Name', 'carolina'), 'desc' => '', 'std' => 'sidebar', 'type' => 'sidebar-select', 'condition' => 'carolina_contact_global_option:is(no),carolina_contact_sidebar_option:is(no)'), array('id' => 'site_contact_sidebar_position', 'label' => esc_html__('Sidebar Position', 'carolina'), 'desc' => '', 'std' => 'right', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('Left', 'carolina'), 'value' => 'left'), array('label' => esc_html__('Right', 'carolina'), 'value' => 'right')), 'condition' => 'carolina_contact_global_option:is(no),carolina_contact_sidebar_option:is(no)')));
    $carolina_recipe_post_type_meta_box = array('id' => 'recipe_post_meta_box', 'title' => esc_html__('Icons', 'carolina'), 'desc' => '', 'pages' => array('recipe'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('id' => 'recipe_post_meta_box_option', 'label' => esc_html__('Upload Icons', 'carolina'), 'desc' => '', 'std' => '', 'type' => 'upload', 'class' => '')));
    $carolina_page_meta_box = array('id' => 'carolina_page_meta_box', 'title' => esc_html__('Page Option', 'carolina'), 'desc' => '', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => esc_html__('Title', 'carolina'), 'id' => 'carolina_page_title', 'type' => 'tab'), array('id' => 'site_carolina_page_title', 'label' => esc_html__('Enter the title for the Page', 'carolina'), 'type' => 'text'), array('id' => 'site_carolina_page_description', 'label' => esc_html__('Enter the description for the Page', 'carolina'), 'type' => 'textarea-simple'), array('label' => esc_html__('Sidebar', 'carolina'), 'id' => 'carolina_page_option', 'type' => 'tab'), array('id' => 'site_page_global_option', 'label' => esc_html__('Enable Global Settings', 'carolina'), 'desc' => '', 'std' => 'yes', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_page_sidebar_option', 'label' => esc_html__('Disable Sidebar', 'carolina'), 'desc' => '', 'std' => 'no', 'type' => 'radio', 'class' => '', 'choices' => array(array('label' => esc_html__('Yes', 'carolina'), 'value' => 'yes'), array('label' => esc_html__('No', 'carolina'), 'value' => 'no'))), array('id' => 'site_page_sidebar_name', 'label' => esc_html__('Sidebar Name', 'carolina'), 'desc' => '', 'std' => 'sidebar', 'type' => 'sidebar-select', 'class' => ''), array('id' => 'site_page_sidebar_position', 'label' => esc_html__('Sidebar Position', 'carolina'), 'desc' => '', 'std' => 'right', 'type' => 'select', 'class' => '', 'choices' => array(array('label' => esc_html__('Left', 'carolina'), 'value' => 'left'), array('label' => esc_html__('Right', 'carolina'), 'value' => 'right')))));
    if (function_exists('ot_register_meta_box')) {
        ot_register_meta_box($carolina_recipe_post_type_meta_box);
        $post_id = isset($_GET['post']) ? $_GET['post'] : (isset($_POST['post_ID']) ? $_POST['post_ID'] : false);
        if ($post_id) {
            $post_template = get_post_meta($post_id, '_wp_page_template', true);
            // Home page metabox
            if ($post_template == 'page-home.php') {
                ot_register_meta_box($carolina_home_meta_box);
            }
            // About us metabox
            if ($post_template == 'page-carolina.php') {
                ot_register_meta_box($carolina_about_meta_box);
            }
            // Contact us metabox
            if ($post_template == 'page-contact.php') {
                ot_register_meta_box($carolina_contact_meta_box);
            }
            if ($post_template == 'page-recipe.php') {
                ot_register_meta_box($carolina_recipe_meta_box);
            }
            if ($post_template == 'default') {
                ot_register_meta_box($carolina_page_meta_box);
            }
        }
    }
}
Пример #29
0
 /**
  * Adds the roles page to the admin.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function add_admin_page()
 {
     // The "Roles" page should be shown for anyone that has the 'list_roles', 'edit_roles', or
     // 'delete_roles' caps, so we're checking against all three.
     $edit_roles_cap = 'list_roles';
     // If the current user can 'edit_roles'.
     if (current_user_can('edit_roles')) {
         $edit_roles_cap = 'edit_roles';
     } elseif (current_user_can('delete_roles')) {
         $edit_roles_cap = 'delete_roles';
     }
     // Get the page title.
     $title = esc_html__('Roles', 'members');
     if (isset($_GET['action']) && 'edit' === $_GET['action'] && isset($_GET['role'])) {
         $title = esc_html__('Edit Role', 'members');
     }
     // Create the Manage Roles page.
     $this->page = add_submenu_page('users.php', $title, esc_html__('Roles', 'members'), $edit_roles_cap, 'roles', array($this, 'page'));
     // Let's roll if we have a page.
     if ($this->page) {
         // If viewing the edit role page.
         if (isset($_REQUEST['action']) && 'edit' === $_REQUEST['action'] && current_user_can('edit_roles')) {
             $this->page_obj = new Members_Admin_Role_Edit();
         } else {
             $this->page_obj = new Members_Admin_Roles();
         }
         // Load actions.
         add_action("load-{$this->page}", array($this, 'load'));
         // Load scripts/styles.
         add_action('admin_enqueue_scripts', array($this, 'enqueue'));
     }
 }
Пример #30
-1
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function xmaps_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'xmaps'));
         if ($categories_list && xmaps_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'xmaps') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'xmaps'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'xmaps') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         /* translators: %s: post title */
         comments_popup_link(sprintf(wp_kses(__('Leave a Comment<span class="screen-reader-text"> on %s</span>', 'xmaps'), array('span' => array('class' => array()))), get_the_title()));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'xmaps'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }