コード例 #1
1
 /**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "No Return-Data. Customer MUST wait for Email Confirmation.";
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering an Initial/Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only (i.e. behind-the-scene), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
コード例 #2
0
function register_taxonomies($sitio, $name, $type, $slug)
{
    //    return;
    $labels_cat = array('name' => _x($name, 'Taxonomy General Name', $sitio), 'singular_name' => _x('Categoría', 'Taxonomy Singular Name', $sitio), 'menu_name' => __($name, $sitio), 'all_items' => __('Todas', $sitio), 'parent_item' => __($name . ' padre', $sitio), 'parent_item_colon' => __($name . ' padre:', $sitio), 'new_item_name' => __('Agregar nueva ' . $name, $sitio), 'add_new_item' => __('Agregar nueva', $sitio), 'edit_item' => __('Editar', $sitio), 'update_item' => __('Actualizar', $sitio), 'separate_items_with_commas' => __('Separar ' . $name . ' por comas', $sitio), 'search_items' => __('Buscar ' . $name, $sitio), 'add_or_remove_items' => __('Agregar o borrar ' . $name, $sitio), 'choose_from_most_used' => __('Elegir de las más usuadas', $sitio), 'not_found' => __('No encontrado', $sitio));
    $args_cat = array('labels' => $labels_cat, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false);
    register_taxonomy($slug, array($type), $args_cat);
}
コード例 #3
0
ファイル: facility.php プロジェクト: gabzon/experiensa
 function facility_post_type($post_types)
 {
     $labels = array('name' => _x('Facility', 'Post Type General Name', 'sage'), 'singular_name' => _x('Facility', 'Post Type Singular Name', 'sage'), 'menu_name' => __('Facilities', 'sage'), 'name_admin_bar' => __('Facilities', 'sage'), 'parent_item_colon' => __('Parent Facility:', 'sage'), 'all_items' => __('All Facilities', 'sage'), 'add_new_item' => __('Add New Facility', 'sage'), 'add_new' => __('Add New', 'sage'), 'new_item' => __('New Facility', 'sage'), 'edit_item' => __('Edit Facility', 'sage'), 'update_item' => __('Update Facility', 'sage'), 'view_item' => __('View Facility', 'sage'), 'search_items' => __('Search Facility', 'sage'), 'not_found' => __('Not found', 'sage'), 'not_found_in_trash' => __('Not found in Trash', 'sage'), 'items_list' => __('Facility list', 'sage'), 'items_list_navigation' => __('Facility list navigation', 'sage'), 'filter_items_list' => __('Filter Facility list', 'sage'));
     $rewrite = array('slug' => 'facility', 'with_front' => true, 'pages' => true, 'feeds' => true);
     $post_types['facility'] = array('label' => __('Facilities', 'sage'), 'description' => __('List of facilities in the establishment', 'sage'), 'labels' => $labels, 'supports' => array('title', 'thumbnail', 'excerpt', 'revisions'), 'taxonomies' => array('facility-type', 'category', 'post_tag'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 7, 'menu_icon' => 'dashicons-welcome-view-site', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'show_in_rest' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page');
     return $post_types;
 }
コード例 #4
0
ファイル: slide.php プロジェクト: Ksajikyan/poiskuslug.ru
/**
 * Initialize Pitch's slide post type
 */
function pitch_slide_init()
{
    $labels = array('name' => _x('Slides', 'post type general name', 'pitch'), 'singular_name' => _x('Slide', 'post type singular name', 'pitch'), 'add_new' => _x('Add New', 'book', 'pitch'), 'add_new_item' => __('Add New Slide', 'pitch'), 'edit_item' => __('Edit Slide', 'pitch'), 'new_item' => __('New Slide', 'pitch'), 'all_items' => __('All Slide', 'pitch'), 'view_item' => __('View Slide', 'pitch'), 'search_items' => __('Search Slides', 'pitch'), 'not_found' => __('No slides found', 'pitch'), 'not_found_in_trash' => __('No slides found in Trash', 'pitch'), 'parent_item_colon' => '', 'menu_name' => __('Slides', 'pitch'));
    $args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'thumbnail', 'excerpt', 'page-attributes'), 'menu_icon' => get_template_directory_uri() . '/images/post-types/slider-small.png');
    register_post_type('slide', $args);
    add_image_size('slide', 960, siteorigin_setting('slider_height'), true);
}
コード例 #5
0
ファイル: formatting.php プロジェクト: laiello/cartonbank
/**
 * Replaces common plain text characters into formatted entities
 *
 * As an example,
 * <code>
 * 'cause today's effort makes it worth tomorrow's "holiday"...
 * </code>
 * Becomes:
 * <code>
 * &#8217;cause today&#8217;s effort makes it worth tomorrow&#8217;s &#8220;holiday&#8221;&#8230;
 * </code>
 * Code within certain html blocks are skipped.
 *
 * @since 0.71
 * @uses $wp_cockneyreplace Array of formatted entities for certain common phrases
 *
 * @param string $text The text to be formatted
 * @return string The string replaced with html entities
 */
function wptexturize($text)
{
    global $wp_cockneyreplace;
    static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
    $output = '';
    $curl = '';
    $textarr = preg_split('/(<.*>|\\[.*\\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
    $stop = count($textarr);
    // No need to set up these variables more than once
    if (!$static_setup) {
        /* translators: opening curly quote */
        $opening_quote = _x('&#8220;', 'opening curly quote');
        /* translators: closing curly quote */
        $closing_quote = _x('&#8221;', 'closing curly quote');
        $default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt');
        $default_no_texturize_shortcodes = array('code');
        // if a plugin has provided an autocorrect array, use it
        if (isset($wp_cockneyreplace)) {
            $cockney = array_keys($wp_cockneyreplace);
            $cockneyreplace = array_values($wp_cockneyreplace);
        } else {
            $cockney = array("'tain't", "'twere", "'twas", "'tis", "'twill", "'til", "'bout", "'nuff", "'round", "'cause");
            $cockneyreplace = array("&#8217;tain&#8217;t", "&#8217;twere", "&#8217;twas", "&#8217;tis", "&#8217;twill", "&#8217;til", "&#8217;bout", "&#8217;nuff", "&#8217;round", "&#8217;cause");
        }
        $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'\'', ' (tm)'), $cockney);
        $static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, $closing_quote, ' &#8482;'), $cockneyreplace);
        $dynamic_characters = array('/\'(\\d\\d(?:&#8217;|\')?s)/', '/\'(\\d+)/', '/(\\s|\\A|[([{<]|")\'/', '/(\\d+)"/', '/(\\d+)\'/', '/(\\S)\'([^\'\\s])/', '/(\\s|\\A|[([{<])"(?!\\s)/', '/"(\\s|\\S|\\Z)/', '/\'([\\s.]|\\Z)/', '/\\b(\\d+)x(\\d+)\\b/');
        $dynamic_replacements = array('&#8217;$1', '&#8217;$1', '$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');
        $static_setup = true;
    }
    // Transform into regexp sub-expression used in _wptexturize_pushpop_element
    // Must do this everytime in case plugins use these filters in a context sensitive manner
    $no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags)) . ')';
    $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes)) . ')';
    $no_texturize_tags_stack = array();
    $no_texturize_shortcodes_stack = array();
    for ($i = 0; $i < $stop; $i++) {
        $curl = $textarr[$i];
        if (!empty($curl) && '<' != $curl[0] && '[' != $curl[0] && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) {
            // This is not a tag, nor is the texturization disabled
            // static strings
            $curl = str_replace($static_characters, $static_replacements, $curl);
            // regular expressions
            $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
        } elseif (!empty($curl)) {
            /*
             * Only call _wptexturize_pushpop_element if first char is correct
             * tag opening
             */
            if ('<' == $curl[0]) {
                _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
            } elseif ('[' == $curl[0]) {
                _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
            }
        }
        $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);
        $output .= $curl;
    }
    return $output;
}
コード例 #6
0
function wp_ajax_ajax_tag_search()
{
    global $wpdb;
    if (isset($_GET['tax'])) {
        $taxonomy = sanitize_key($_GET['tax']);
        $tax = get_taxonomy($taxonomy);
        if (!$tax) {
            wp_die(0);
        }
        if (!current_user_can($tax->cap->assign_terms)) {
            wp_die(-1);
        }
    } else {
        wp_die(0);
    }
    $s = stripslashes($_GET['q']);
    $comma = _x(',', 'tag delimiter');
    if (',' !== $comma) {
        $s = str_replace($comma, ',', $s);
    }
    if (false !== strpos($s, ',')) {
        $s = explode(',', $s);
        $s = $s[count($s) - 1];
    }
    $s = trim($s);
    if (strlen($s) < 2) {
        wp_die();
    }
    // require 2 chars for matching
    $results = $wpdb->get_col($wpdb->prepare("SELECT t.name FROM {$wpdb->term_taxonomy} AS tt INNER JOIN {$wpdb->terms} AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . like_escape($s) . '%'));
    echo join($results, "\n");
    wp_die();
}
コード例 #7
0
/**
 * UCFBands CPT: Location
 * Register CPT
 *
 * @author Jordan Pakrosnis
 */
function ucfbands_cpt_location()
{
    $labels = array('name' => _x('Locations', 'Post Type General Name', 'text_domain'), 'singular_name' => _x('Location', 'Post Type Singular Name', 'text_domain'), 'menu_name' => __('Locations', 'text_domain'), 'parent_item_colon' => __('Parent Item:', 'text_domain'), 'all_items' => __('All Locations', 'text_domain'), 'view_item' => __('View Location', 'text_domain'), 'add_new_item' => __('Add New Location', 'text_domain'), 'add_new' => __('Add Location', 'text_domain'), 'edit_item' => __('Edit Location', 'text_domain'), 'update_item' => __('Update Location', 'text_domain'), 'search_items' => __('Search Locations', 'text_domain'), 'not_found' => __('Not found', 'text_domain'), 'not_found_in_trash' => __('Not found in Trash', 'text_domain'));
    $rewrite = array('slug' => 'locations', 'with_front' => true, 'pages' => true, 'feeds' => false);
    $args = array('label' => __('ucfbands_location', 'text_domain'), 'description' => __('UCF Bands Event Locations', 'text_domain'), 'labels' => $labels, 'supports' => array('title', 'thumbnail'), 'taxonomies' => array(), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 4, 'menu_icon' => 'dashicons-location-alt', 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page');
    register_post_type('ucfbands_location', $args);
}
コード例 #8
0
ファイル: post-types.php プロジェクト: jackmachin/bayer
/**
 * Add custom taxonomies *
 * Additional custom taxonomies can be defined here
 * http://codex.wordpress.org/Function_Reference/register_taxonomy
 */

function add_custom_taxonomies() {
	// Add new "Locations" taxonomy to Posts
	register_taxonomy('p_category', 'portfolio', array(
			// Hierarchical taxonomy (like categories)
			'hierarchical' => true, // This array of options controls the labels displayed in the WordPress Admin UI
			'labels' => array(
				'name' => _x( 'Portfolio Category', 'taxonomy general name', 'studiofolio' ),
				'singular_name' => _x( 'Category', 'taxonomy singular name', 'studiofolio' ),
				'search_items' => __( 'Search Category', 'studiofolio' ),
				'all_items' => __( 'All Categories', 'studiofolio' ),
				'parent_item' => __( 'Parent Category', 'studiofolio' ),
				'parent_item_colon' => __( 'Parent Category:', 'studiofolio' ),
				'edit_item' => __( 'Edit Category', 'studiofolio' ),
				'update_item' => __( 'Update Category', 'studiofolio' ),
				'add_new_item' => __( 'Add New Category', 'studiofolio' ),
				'new_item_name' => __( 'New Category Name', 'studiofolio' ),
				'menu_name' => __( 'Portfolio Categories', 'studiofolio' ),
			), // Control the slugs used for this taxonomy
			'rewrite' => array(
				'slug' => 'portfolio-category', // This controls the base slug that will display before each term
				'with_front' => false, // Don't display the category base before "/locations/"
				'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
			),
		)
	);

};
コード例 #9
0
function create_candidate_disciplines_taxonomies()
{
    // Add new taxonomy, make it hierarchical (like categories)
    $labels = array('name' => _x('Disciplines', 'taxonomy general name'), 'singular_name' => _x('Discipline', 'taxonomy singular name'), 'search_items' => __('Search Disciplines'), 'all_items' => __('All Disciplines'), 'parent_item' => __('Parent Discipline'), 'parent_item_colon' => __('Parent Industry'), 'edit_item' => __('Edit Discipline'), 'update_item' => __('Update Disciplines'), 'add_new_item' => __('Add New Discipline'), 'new_item_name' => __('New Disciplines'), 'menu_name' => __('Disciplines'));
    $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'discipline'));
    register_taxonomy('disciplines', array('associate'), $args);
}
コード例 #10
0
 /**
  * Field configuration
  *
  * This is used by CTFW_Widget class for automatic field output, filtering, sanitization and saving.
  *
  * @since 0.9
  * @return array Fields for widget
  */
 function ctfw_fields()
 {
     // prefix in case WP core adds method with same name
     // Fields
     $fields = array('title' => array('name' => _x('Title', 'giving widget', 'church-theme-framework'), 'after_name' => '', 'desc' => '', 'type' => 'text', 'checkbox_label' => '', 'radio_inline' => false, 'number_min' => '', 'number_max' => '', 'options' => array(), 'default' => _x('Giving', 'giving widget default title', 'church-theme-framework'), 'no_empty' => false, 'allow_html' => false, 'attributes' => array(), 'class' => '', 'field_attributes' => array(), 'field_class' => '', 'custom_sanitize' => '', 'custom_field' => '', 'taxonomies' => array()), 'text' => array('name' => _x('Message', 'giving widget', 'church-theme-framework'), 'after_name' => '', 'desc' => '', 'type' => 'textarea', 'checkbox_label' => '', 'radio_inline' => false, 'number_min' => '', 'number_max' => '', 'options' => array(), 'default' => __('You may give online by clicking below.', 'church-theme-framework'), 'no_empty' => false, 'allow_html' => true, 'attributes' => array(), 'class' => '', 'field_attributes' => array(), 'field_class' => '', 'custom_sanitize' => '', 'custom_field' => '', 'taxonomies' => array()), 'button_text' => array('name' => _x('Button Text', 'giving widget', 'church-theme-framework'), 'after_name' => '', 'desc' => '', 'type' => 'text', 'checkbox_label' => '', 'radio_inline' => false, 'number_min' => '', 'number_max' => '', 'options' => array(), 'default' => _x('Give Now', 'giving widget', 'church-theme-framework'), 'no_empty' => false, 'allow_html' => false, 'attributes' => array(), 'class' => '', 'field_attributes' => array(), 'field_class' => '', 'custom_sanitize' => '', 'custom_field' => '', 'taxonomies' => array()), 'button_url' => array('name' => _x('Button URL', 'giving widget', 'church-theme-framework'), 'after_name' => '', 'desc' => '', 'type' => 'url', 'checkbox_label' => '', 'radio_inline' => false, 'number_min' => '', 'number_max' => '', 'options' => array(), 'default' => '', 'no_empty' => false, 'allow_html' => false, 'attributes' => array(), 'class' => '', 'field_attributes' => array(), 'field_class' => '', 'custom_sanitize' => '', 'custom_field' => '', 'taxonomies' => array()));
     return $fields;
 }
コード例 #11
0
ファイル: file.php プロジェクト: scotlanddig/bootstrap_basic
        /**
         * Get field HTML
         *
         * @param string $html
         * @param mixed  $meta
         * @param array  $field
         *
         * @return string
         */
        static function html($html, $meta, $field)
        {
            $i18n_delete = _x('Delete', 'file upload', 'bootstrap');
            $i18n_title = _x('Upload files', 'file upload', 'bootstrap');
            $i18n_more = _x('+ Add new file', 'file upload', 'bootstrap');
            $html = wp_nonce_field("rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false);
            $html .= "<input type='hidden' class='field-id' value='{$field['id']}' />";
            // Uploaded files
            if (!empty($meta)) {
                $html .= '<ol class="rwmb-uploaded">';
                $li = '<li>%s (<a title="%s" class="rwmb-delete-file" href="#" rel="%s">%s</a>)</li>';
                foreach ($meta as $attachment_id) {
                    $attachment = wp_get_attachment_link($attachment_id);
                    $html .= sprintf($li, $attachment, $i18n_delete, $attachment_id, $i18n_delete);
                }
                $html .= '</ol>';
            }
            // Show form upload
            $html .= sprintf('<h4>%s</h4>
				<div class="new-files">
					<div class="file-input"><input type="file" name="%s[]" /></div>
					<a class="rwmb-add-file" href="#"><strong>%s</strong></a>
				</div>', $i18n_title, $field['id'], $i18n_more);
            return $html;
        }
コード例 #12
0
 public function __construct($args)
 {
     extract($args);
     if ($slug) {
         $plural = inflector()->titleize($plural ? $plural : inflector()->pluralize($slug));
         $name = inflector()->titleize($name ? $name : inflector()->humanize($slug));
         $menu_name = $menu_name ? inflector()->titleize($menu_name) : $plural;
         $all_items = $all_items ? inflector()->titleize($all_items) : 'All ' . $plural;
         $labels = array('name' => _x($plural, 'post type general name', CREATIVE_LITTLE_DOMAIN), 'singular_name' => _x($name, 'post type singular name', CREATIVE_LITTLE_DOMAIN), 'menu_name' => _x($menu_name, 'admin menu', CREATIVE_LITTLE_DOMAIN), 'name_admin_bar' => _x($name, 'add new on admin bar', CREATIVE_LITTLE_DOMAIN), 'add_new' => _x('Add New', $slug, CREATIVE_LITTLE_DOMAIN), 'add_new_item' => __('Add New ' . $name, CREATIVE_LITTLE_DOMAIN), 'new_item' => __('New ' . $name, CREATIVE_LITTLE_DOMAIN), 'edit_item' => __('Edit ' . $name, CREATIVE_LITTLE_DOMAIN), 'view_item' => __('View ' . $name, CREATIVE_LITTLE_DOMAIN), 'all_items' => __($all_items, CREATIVE_LITTLE_DOMAIN), 'search_items' => __('Search ' . $plural, CREATIVE_LITTLE_DOMAIN), 'parent_item_colon' => __('Parent ' . $plural . ':', CREATIVE_LITTLE_DOMAIN), 'not_found' => __('No ' . strtolower($plural) . ' found.', CREATIVE_LITTLE_DOMAIN), 'not_found_in_trash' => __('No ' . strtolower($plural) . ' found in Trash.', CREATIVE_LITTLE_DOMAIN));
         $args = array('labels' => $labels, 'public' => $public, 'publicly_queryable' => $publicly_queryable, 'show_ui' => true, 'show_in_menu' => $show_in_menu, 'query_var' => true, 'rewrite' => $rewrite && $rewrite !== true ? $rewrite : array('slug' => inflector()->dasherize(strtolower($slug))), 'capability_type' => 'post', 'has_archive' => $has_archive ? strtolower($plural) : false, 'menu_icon' => $icon, 'hierarchical' => $hierarchical, 'menu_position' => null, 'supports' => $supports);
         register_post_type($slug, $args);
         if (method_exists($this, 'save_' . $slug)) {
             add_action('save_post', array($this, 'save_' . $slug));
         }
         if ($row_actions) {
             $actionType = $hierarchical ? 'page' : 'post';
             add_filter($actionType . '_row_actions', function ($actions, $post) {
                 if ($post->post_type == $slug) {
                     foreach ($row_actions as $action_key => $action) {
                         $actions[$action_key] = '<a href="' . admin_url('post.php?post=' . $post->ID . '&action=' . $action_key) . '">' . $action['name'] . '</a>';
                     }
                 }
                 return $actions;
             }, 10, 2);
             add_action('admin_init', function () {
                 if (isset($_REQUEST['post']) && isset($_REQUEST['action']) && isset($row_actions[$_REQUEST['action']])) {
                     if (isset($row_actions[$_REQUEST['action']]['callback']) && $row_actions[$_REQUEST['action']]['callback'] && method_exists($this, $row_actions[$_REQUEST['action']]['callback'])) {
                         call_user_func(array(__CLASS__, $row_actions[$_REQUEST['action']]['callback']));
                     }
                 }
             });
         }
     }
 }
コード例 #13
0
ファイル: facebook.php プロジェクト: leotaillard/btws2016
 protected function get_rows($metabox, $key)
 {
     $rows = array();
     switch ($metabox . '-' . $key) {
         case 'fb-all':
             $rows[] = $this->p->util->get_th(_x('Show Button in', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->show_on_checkboxes('fb') . '</td>';
             $rows[] = $this->p->util->get_th(_x('Preferred Order', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_order', range(1, count($this->p->admin->submenu['sharing']->website)), 'short') . '</td>';
             $rows[] = '<tr class="hide_in_basic">' . $this->p->util->get_th(_x('JavaScript in', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_script_loc', $this->p->cf['form']['script_locations']) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Default Language', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_lang', SucomUtil::get_pub_lang('facebook')) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Button Type', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_button', array('like' => 'Like and Send', 'share' => 'Share')) . '</td>';
             break;
         case 'fb-like':
             $rows[] = $this->p->util->get_th(_x('Markup Language', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_markup', array('html5' => 'HTML5', 'xfbml' => 'XFBML')) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Include Send', 'option label (short)', 'nextgen-facebook'), 'short', null, 'The Send button is only available in combination with the XFBML <em>Markup Language</em>.') . '<td>' . $this->form->get_checkbox('fb_send') . '</td>';
             $rows[] = $this->p->util->get_th(_x('Layout', 'option label (short)', 'nextgen-facebook'), 'short', null, 'The Standard layout displays social text to the right of the button, and friends\' profile photos below (if <em>Show Faces</em> is also checked). The Button Count layout displays the total number of likes to the right of the button, and the Box Count layout displays the total number of likes above the button. See the <a href="https://developers.facebook.com/docs/plugins/like-button#faqlayout" target="_blank">Facebook Layout Settings FAQ</a> for more details.') . '<td>' . $this->form->get_select('fb_layout', array('standard' => 'Standard', 'button' => 'Button', 'button_count' => 'Button Count', 'box_count' => 'Box Count')) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Show Faces', 'option label (short)', 'nextgen-facebook'), 'short', null, 'Show profile photos below the Standard button (Standard button <em>Layout</em> only).') . '<td>' . $this->form->get_checkbox('fb_show_faces') . '</td>';
             $rows[] = $this->p->util->get_th(_x('Font', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_font', array('arial' => 'Arial', 'lucida grande' => 'Lucida Grande', 'segoe ui' => 'Segoe UI', 'tahoma' => 'Tahoma', 'trebuchet ms' => 'Trebuchet MS', 'verdana' => 'Verdana')) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Color Scheme', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_colorscheme', array('light' => 'Light', 'dark' => 'Dark')) . '</td>';
             $rows[] = $this->p->util->get_th(_x('Action Name', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_action', array('like' => 'Like', 'recommend' => 'Recommend')) . '</td>';
             break;
         case 'fb-share':
             $rows[] = $this->p->util->get_th(_x('Layout', 'option label (short)', 'nextgen-facebook'), 'short') . '<td>' . $this->form->get_select('fb_type', array('button' => 'Button', 'button_count' => 'Button Count', 'box_count' => 'Box Count', 'icon' => 'Small Icon', 'icon_link' => 'Icon Link', 'link' => 'Text Link')) . '</td>';
             break;
     }
     return $rows;
 }
コード例 #14
0
ファイル: functions.php プロジェクト: ningenis/pvjtt
/**
 * Return the Google font stylesheet URL if available.
 *
 * The use of Open Sans by default is localized. For languages that use
 * characters not supported by the font, the font can be disabled.
 *
 * @since Flexy  1.2
 *
 * @return string Font stylesheet or empty string if disabled.
 */
function flexy_get_font_url()
{
    $font_url = '';
    /* translators: If there are characters in your language that are not supported
     * by Open Sans, translate this to 'off'. Do not translate into your own language.
     */
    if ('off' !== _x('on', 'Open Sans font: on or off', 'flexy')) {
        $subsets = 'latin,latin-ext';
        /* translators: To add an additional Open Sans character subset specific to your language,
         * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
         */
        $subset = _x('no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'flexy');
        if ('cyrillic' == $subset) {
            $subsets .= ',cyrillic,cyrillic-ext';
        } elseif ('greek' == $subset) {
            $subsets .= ',greek,greek-ext';
        } elseif ('vietnamese' == $subset) {
            $subsets .= ',vietnamese';
        }
        $protocol = is_ssl() ? 'https' : 'http';
        $query_args = array('family' => 'Open+Sans:400italic,700italic,400,700', 'subset' => $subsets);
        $font_url = add_query_arg($query_args, "{$protocol}://fonts.googleapis.com/css");
    }
    return $font_url;
}
コード例 #15
0
ファイル: gallery.php プロジェクト: craighays/nsfhp
 /**
  * Register Custom Taxonomy
  *
  * @since 1.0.0
  */
 public function wpl_toolskit_gallery_taxomomy()
 {
     $labels = array('name' => _x($this->wpl_get_name_singular() . ' ' . 'Categories', 'Taxonomy General Name', 'charitylife-toolskit'), 'singular_name' => _x($this->wpl_get_name_singular() . ' ' . 'Category', 'Taxonomy Singular Name', 'charitylife-toolskit'), 'menu_name' => __($this->wpl_get_name_singular() . ' ' . 'Categories', 'charitylife-toolskit'), 'all_items' => __('All Categories', 'charitylife-toolskit'), 'parent_item' => __('Parent Category', 'charitylife-toolskit'), 'parent_item_colon' => __('Parent Category:', 'charitylife-toolskit'), 'new_item_name' => __('New Category Name', 'charitylife-toolskit'), 'add_new_item' => __('Add New Category', 'charitylife-toolskit'), 'edit_item' => __('Edit Category', 'charitylife-toolskit'), 'update_item' => __('Update Category', 'charitylife-toolskit'), 'view_item' => __('View Category', 'charitylife-toolskit'), 'separate_items_with_commas' => __('Separate items with commas', 'charitylife-toolskit'), 'add_or_remove_items' => __('Add or remove items', 'charitylife-toolskit'), 'choose_from_most_used' => __('Choose from the most used', 'charitylife-toolskit'), 'popular_items' => __('Popular Categories', 'charitylife-toolskit'), 'search_items' => __('Search Categories', 'charitylife-toolskit'), 'not_found' => __('Not Found', 'charitylife-toolskit'));
     $args = array('labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false, 'rewrite' => array('slug' => $this->wpl_get_category_url_rewrite()));
     register_taxonomy('wpl_gallery_category', array('post_gallery'), $args);
     flush_rewrite_rules();
 }
コード例 #16
0
/**
 * Add contextual help to the Themes and Post edit screens.
 *
 * @since Twenty Fourteen 1.0
 */
function twentyfourteen_contextual_help()
{
    if ('admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow']) {
        return;
    }
    get_current_screen()->add_help_tab(array('id' => 'twentyfourteen', 'title' => __('Twenty Fourteen', 'twentyfourteen'), 'content' => '<ul>' . '<li>' . sprintf(__('The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('customize.php'), admin_url('edit.php?show_sticky=1')) . '</li>' . '<li>' . sprintf(__('Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen'), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail') . '</li>' . '<li>' . sprintf(__('For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen'), 'https://codex.wordpress.org/Twenty_Fourteen') . '</li>' . '</ul>'));
}
コード例 #17
0
function igthemes_font_url()
{
    $fonts_url = '';
    $fonts = array();
    $subsets = 'latin,latin-ext';
    /*
     * Translators: If there are characters in your language that are not supported,
     * translate this to 'off'. Do not translate into your own language.
     */
    if ('off' !== _x('on', 'Open Sans font: on or off', 'store-wp')) {
        $fonts[] = 'Open Sans:300italic,400italic,700italic,300,400,700';
    }
    /*
     * Translators: To add an additional character subset specific to your language,
     * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     */
    $subset = _x('no-subset', 'Add new subset (greek, cyrillic, vietnamese)', 'store-wp');
    if ('cyrillic' == $subset) {
        $subsets .= ',cyrillic,cyrillic-ext';
    } elseif ('greek' == $subset) {
        $subsets .= ',greek,greek-ext';
    } elseif ('devanagari' == $subset) {
        $subsets .= ',devanagari';
    }
    if ($fonts) {
        $fonts_url = add_query_arg(array('family' => urlencode(implode('|', $fonts)), 'subset' => urlencode($subsets)), '//fonts.googleapis.com/css');
    }
    return $fonts_url;
}
コード例 #18
0
 /**
  * Register new post type
  * @return void
  */
 public function register_post_type()
 {
     $labels = array('name' => $this->plural, 'singular_name' => $this->single, 'name_admin_bar' => $this->single, 'add_new' => _x('Add New', $this->post_type, 'wp-email-delivery'), 'add_new_item' => sprintf(__('Add New %s', 'wp-email-delivery'), $this->single), 'edit_item' => sprintf(__('Edit %s', 'wp-email-delivery'), $this->single), 'new_item' => sprintf(__('New %s', 'wp-email-delivery'), $this->single), 'all_items' => sprintf(__('All %s', 'wp-email-delivery'), $this->plural), 'view_item' => sprintf(__('View %s', 'wp-email-delivery'), $this->single), 'search_items' => sprintf(__('Search %s', 'wp-email-delivery'), $this->plural), 'not_found' => sprintf(__('No %s Found', 'wp-email-delivery'), $this->plural), 'not_found_in_trash' => sprintf(__('No %s Found In Trash', 'wp-email-delivery'), $this->plural), 'parent_item_colon' => sprintf(__('Parent %s'), $this->single), 'menu_name' => $this->plural);
     $args = array('labels' => apply_filters($this->post_type . '_labels', $labels), 'description' => $this->description, 'public' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'can_export' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => true, 'supports' => array('title', 'editor', 'excerpt', 'comments', 'thumbnail'), 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-post');
     $args = array_merge($args, $this->options);
     register_post_type($this->post_type, apply_filters($this->post_type . '_register_args', $args, $this->post_type));
 }
コード例 #19
0
 function __construct()
 {
     /* Widget settings. */
     $widget_ops = array('description' => _x('Custom menu style 2', 'widget', 'the7mk2'));
     /* Create the widget. */
     parent::__construct('presscore-custom-menu-2', DT_WIDGET_PREFIX . _x('Custom menu style 2', 'widget', 'the7mk2'), $widget_ops);
 }
コード例 #20
0
ファイル: customizer.php プロジェクト: serranoabq/cultiv8
/**
* 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')));
    }
}
コード例 #21
0
ファイル: location.php プロジェクト: gabzon/experiensa
 function location_taxonomy()
 {
     $labels = array('name' => _x('Locations', 'Taxonomy General Name', 'sage'), 'singular_name' => _x('Location', 'Taxonomy Singular Name', 'sage'), 'menu_name' => __('Locations', 'sage'), 'all_items' => __('All Locations', 'sage'), 'parent_item' => __('Parent Location', 'sage'), 'parent_item_colon' => __('Parent Location:', 'sage'), 'new_item_name' => __('New Location Name', 'sage'), 'add_new_item' => __('Add New Location', 'sage'), 'edit_item' => __('Edit Location', 'sage'), 'update_item' => __('Update Location', 'sage'), 'view_item' => __('View Location', 'sage'), 'separate_items_with_commas' => __('Separate Locations with commas', 'sage'), 'add_or_remove_items' => __('Add or remove Locations', 'sage'), 'choose_from_most_used' => __('Choose from the most used', 'sage'), 'popular_items' => __('Popular Locations', 'sage'), 'search_items' => __('Search Locations', 'sage'), 'not_found' => __('Not Found', 'sage'), 'items_list' => __('Locations list', 'sage'), 'items_list_navigation' => __('Locations list navigation', 'sage'));
     $rewrite = array('slug' => 'location', 'with_front' => true, 'hierarchical' => false);
     $args = array('labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, 'rewrite' => $rewrite);
     register_taxonomy('location', array('post', 'attachment', 'voyage', 'estimate', 'service', 'host', 'partner'), $args);
 }
コード例 #22
0
ファイル: image.php プロジェクト: hunghoang179/sitenews
 /**
  * Get field HTML
  *
  * @param string $html
  * @param mixed  $meta
  * @param array  $field
  *
  * @return string
  */
 static function html($html, $meta, $field)
 {
     global $wpdb;
     $i18n_msg = _x('Uploaded files', 'image upload', RWMB_TEXTDOMAIN);
     $i18n_del_file = _x('Delete this file', 'image upload', RWMB_TEXTDOMAIN);
     $i18n_delete = _x('Delete', 'image upload', RWMB_TEXTDOMAIN);
     $i18n_edit = _x('Edit', 'image upload', RWMB_TEXTDOMAIN);
     $i18n_title = _x('Upload files', 'image upload', RWMB_TEXTDOMAIN);
     $i18n_more = _x('Add another file', 'image upload', RWMB_TEXTDOMAIN);
     $html = wp_nonce_field("rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false);
     $html .= wp_nonce_field("rwmb-reorder-images_{$field['id']}", "nonce-reorder-images_{$field['id']}", false, false);
     $html .= "<input type='hidden' class='field-id' value='{$field['id']}' />";
     // Uploaded images
     if (!empty($meta)) {
         $html .= "<h4>{$i18n_msg}</h4>";
         $html .= "<ul class='rwmb-images rwmb-uploaded'>";
         foreach ($meta as $image) {
             $src = wp_get_attachment_image_src($image, 'thumbnail');
             $src = $src[0];
             $link = get_edit_post_link($image);
             $html .= "<li id='item_{$image}'>\n\t\t\t\t\t\t<img src='{$src}' />\n\t\t\t\t\t\t<div class='rwmb-image-bar'>\n\t\t\t\t\t\t\t<a title='{$i18n_edit}' class='rwmb-edit-file' href='{$link}' target='_blank'>{$i18n_edit}</a> |\n\t\t\t\t\t\t\t<a title='{$i18n_del_file}' class='rwmb-delete-file' href='#' rel='{$image}'>{$i18n_delete}</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>";
         }
         $html .= '</ul>';
     }
     // Show form upload
     $html .= "\n\t\t\t<h4>{$i18n_title}</h4>\n\t\t\t<div class='new-files'>\n\t\t\t\t<div class='file-input'><input type='file' name='{$field['id']}[]' /></div>\n\t\t\t\t<a class='rwmb-add-file' href='#'>{$i18n_more}</a>\n\t\t\t</div>";
     return $html;
 }
コード例 #23
0
ファイル: control.class.php プロジェクト: ZeroWP/Customizer
 public function child_fields($ctz)
 {
     $setting_args = $this->args;
     $setting_args['type'] = $this->args['transport_type'];
     // Font weight
     $setting_args['default'] = !empty($this->args['font_weight']) ? $this->args['font_weight'] : '400';
     $ctz->add_setting($this->field_id . '_weight', $setting_args);
     $weight_args = $this->args;
     $weight_args['label'] = _x('Weight', 'The font weight', 'zerowp_customizer_local');
     $weight_args['type'] = 'select';
     $weight_args['choices'] = array('100' => '100', '200' => '200', '300' => '300', '400' => _x('Normal - 400', 'Font weight', 'zerowp_customizer_local'), '500' => '500', '600' => '600', '700' => _x('Bold - 700', 'Font weight', 'zerowp_customizer_local'), '800' => '800', '900' => '900');
     $ctz->add_control($this->field_id . '_weight', $weight_args);
     // Font style
     $setting_args['default'] = !empty($this->args['font_style']) && in_array($this->args['font_style'], array('normal', 'italic')) ? $this->args['font_style'] : 'normal';
     $ctz->add_setting($this->field_id . '_style', $setting_args);
     $style_args = $this->args;
     $style_args['label'] = _x('Style', 'The font style', 'zerowp_customizer_local');
     $style_args['type'] = 'radio';
     $style_args['choices'] = array('normal' => _x('normal', 'font style normal', 'zerowp_customizer_local'), 'italic' => _x('italic', 'font style italic', 'zerowp_customizer_local'));
     $ctz->add_control($this->field_id . '_style', $style_args);
     // Font family
     $setting_args['default'] = !empty($this->args['font_family']) ? $this->args['font_family'] : 'sans-serif';
     $ctz->add_setting($this->field_id . '_family', $setting_args);
     $family_args = $this->args;
     $family_args['label'] = _x('Family', 'The font family', 'zerowp_customizer_local');
     $family_args['type'] = 'select';
     $family_args['choices'] = array('sans-serif' => _x('sans-serif', 'Font family', 'zerowp_customizer_local'), 'serif' => _x('serif', 'Font family', 'zerowp_customizer_local'), 'monospace' => _x('monospace', 'Font family', 'zerowp_customizer_local'), 'fantasy' => _x('fantasy', 'Font family', 'zerowp_customizer_local'), 'cursive' => _x('cursive', 'Font family', 'zerowp_customizer_local'));
     $ctz->add_control($this->field_id . '_family', $family_args);
 }
コード例 #24
0
    /**
     * Display navigation to next/previous post when applicable.
     *
     * @return void
     */
    function my_simone_post_nav()
    {
        // Don't print empty markup if there's nowhere to navigate.
        $previous = is_attachment() ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
        $next = get_adjacent_post(false, '', false);
        if (!$next && !$previous) {
            return;
        }
        ?>
	<nav class="navigation post-navigation" role="navigation">
    <div class="post-nav-box clear">
        <h1 class="screen-reader-text"><?php 
        _e('Post navigation', 'my-simone');
        ?>
</h1>
        <div class="nav-links">
            <?php 
        previous_post_link('<div class="nav-previous"><div class="nav-indicator">' . _x('Previous Post:', 'Previous post', 'my-simone') . '</div><h1>%link</h1></div>', '%title');
        next_post_link('<div class="nav-next"><div class="nav-indicator">' . _x('Next Post:', 'Next post', 'my-simone') . '</div><h1>%link</h1></div>', '%title');
        ?>
        </div><!-- .nav-links -->
    </div><!-- .post-nav-box -->
</nav><!-- .navigation -->

			
	<?php 
    }
コード例 #25
0
ファイル: post-types.php プロジェクト: TimurMG/mg-red
function register_custom_post_types()
{
    /* Register custom post types
     *****************************/
    register_post_type('news', array('public' => true, 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/news-icon.png', 'labels' => array('name' => _x('Новости', 'post type general name'), 'singular_name' => _x('Новость', 'post type singular name'), 'add_new' => _x('Добавить новую', 'Новость'), 'add_new_item' => __('Добавить новую новость'), 'edit_item' => __('Редактировать новость'), 'new_item' => __('Новая новость'), 'view_item' => __('Посмотреть новость'), 'search_items' => __('Поиск новостей'), 'not_found' => __('Новостей не найдено'), 'not_found_in_trash' => __('Новостей не найдено в корзине'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'rewrite' => array('slug' => 'nitem', 'with_front' => FALSE), 'register_meta_box_cb' => 'news_add_box', 'supports' => array('title', 'thumbnail', 'excerpt', 'editor', 'author', 'comments')));
    register_post_type('banners', array('public' => true, 'publicly_queryable' => true, 'has_archive' => false, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/banners-icon.png', 'labels' => array('name' => _x('Баннеры', 'post type general name'), 'singular_name' => _x('Баннер', 'post type singular name'), 'add_new' => _x('Добавить новый', 'Баннер'), 'add_new_item' => __('Добавить новый баннер'), 'edit_item' => __('Редактировать баннер'), 'new_item' => __('Новый баннер'), 'view_item' => __('Посмотреть баннер'), 'search_items' => __('Поиск баннеров'), 'not_found' => __('Баннеры не найдены'), 'not_found_in_trash' => __('Корзина пуста'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'rewrite' => array('slug' => 'banners', 'with_front' => FALSE), 'supports' => array('title')));
    register_post_type('ads', array('public' => true, 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/adsa_icon.png', 'labels' => array('name' => _x('Объявления', 'post type general name'), 'singular_name' => _x('Объявление', 'post type singular name'), 'add_new' => _x('Добавить новое', 'Объявление'), 'add_new_item' => __('Добавить новое объявление'), 'edit_item' => __('Редактировать объявление'), 'new_item' => __('Новое объявление'), 'view_item' => __('Посмотреть объявление'), 'search_items' => __('Поиск объявлений'), 'not_found' => __('Объявления не найдены'), 'not_found_in_trash' => __('Корзина пуста'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'rewrite' => array('slug' => 'ads', 'with_front' => FALSE), 'register_meta_box_cb' => 'ads_add_box', 'supports' => array('title', 'thumbnail', 'editor', 'author', 'comments')));
    register_post_type('catalog', array('public' => true, 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/catalog_icon.png', 'labels' => array('name' => _x('Справочник', 'post type general name'), 'singular_name' => _x('Организация', 'post type singular name'), 'add_new' => _x('Добавить организацию', 'Организация'), 'add_new_item' => __('Добавить новую организацию'), 'edit_item' => __('Редактировать организацию'), 'new_item' => __('Новая организация'), 'view_item' => __('Посмотреть организацию'), 'search_items' => __('Поиск организаций'), 'not_found' => __('Организации не найдены'), 'not_found_in_trash' => __('Корзина пуста'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'rewrite' => array('slug' => 'catalog', 'with_front' => FALSE), 'register_meta_box_cb' => 'cat_add_box', 'supports' => array('title', 'thumbnail', 'editor', 'author', 'comments')));
    register_post_type('people', array('public' => true, 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/drs-icon.png', 'labels' => array('name' => _x('Врачи', 'post type general name'), 'singular_name' => _x('Врач', 'post type singular name'), 'add_new' => _x('Добавить врача', 'врач'), 'add_new_item' => __('Добавить нового врача'), 'edit_item' => __('Редактировать запись'), 'new_item' => __('Новый врач'), 'view_item' => __('Посмотреть запись'), 'search_items' => __('Поиск врача'), 'not_found' => __('Записи не найдены'), 'not_found_in_trash' => __('Корзина пуста'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 5, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'register_meta_box_cb' => 'pl_add_box', 'rewrite' => array('slug' => 'people', 'with_front' => FALSE), 'supports' => array('title', 'editor', 'thumbnail', 'comments')));
    /*Новости АВТОМАБИЛКИ начало*/
    register_post_type('som', array('public' => true, 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_icon' => get_stylesheet_directory_uri() . '/images/car-icon.png', 'labels' => array('name' => _x('Somicadze', 'post type general name'), 'singular_name' => _x('Som', 'post type singular name'), 'add_new' => _x('Добавить запись', 'новость'), 'add_new_item' => __('Добавить новую запись'), 'edit_item' => __('Редактировать запись'), 'new_item' => __('Новая запись'), 'view_item' => __('Посмотреть запись'), 'search_items' => __('Поиск записей'), 'not_found' => __('Запись не найдена'), 'not_found_in_trash' => __('Корзина пуста'), 'parent_item_colon' => ''), 'show_ui' => true, 'menu_position' => 6, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => true, 'rewrite' => array('slug' => 'somnews', 'with_front' => FALSE), 'supports' => array('title', 'thumbnail', 'excerpt', 'editor', 'author', 'comments')));
    /* Register custom taxonomies
     *****************************/
    $labelsTags = array('name' => _x('Метки', 'taxonomy general name'), 'singular_name' => _x('Метки', 'taxonomy singular name'), 'search_items' => __('Поиск меток'), 'all_items' => __('Все метки'), 'edit_item' => __('Редактировать метку'), 'update_item' => __('Обновить метку'), 'add_new_item' => __('Добавить новую метку'), 'new_item_name' => __('Новая метка'));
    register_taxonomy('ntag', array('news'), array('hierarchical' => false, 'labels' => $labelsTags, 'show_ui' => 'radio', 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => array('slug' => 'ntag')));
    $labelsCat = array('name' => _x('Рубрики новостей', 'taxonomy general name'), 'singular_name' => _x('Рубрика', 'taxonomy singular name'), 'search_items' => __('Поиск рубрик'), 'all_items' => __('Все рубрики'), 'parent_item' => __('Родительская рубрика'), 'parent_item_colon' => __('Родительская рубрика:'), 'edit_item' => __('Редактировать рубрику'), 'update_item' => __('Обновить рубрику'), 'add_new_item' => __('Добавить новую рубрику'), 'new_item_name' => __('Новая рубрика'));
    register_taxonomy('ncategory', array('news'), array('hierarchical' => true, 'labels' => $labelsCat, 'show_ui' => 'radio', 'query_var' => true, 'rewrite' => array('slug' => 'ncategory')));
    $labelsLoc = array('name' => _x('Регионы', 'taxonomy general name'), 'singular_name' => _x('Регион', 'taxonomy singular name'), 'search_items' => __('Поиск региона'), 'all_items' => __('Все регионы'), 'parent_item' => __('Родительский регион'), 'parent_item_colon' => __('Родительский регион:'), 'edit_item' => __('Редактировать регион'), 'update_item' => __('Обновить регион'), 'add_new_item' => __('Добавить новый регион'), 'new_item_name' => __('Новый регион'));
    register_taxonomy('nlocation', array('news', 'ads', 'catalog'), array('public' => true, 'hierarchical' => true, 'labels' => $labelsLoc, 'query_var' => 'nlocation', 'show_ui' => true, 'rewrite' => array('slug' => 'nlocation', 'with_front' => false)));
    $labelsAdsCat = array('name' => _x('Категории объявлений', 'taxonomy general name'), 'singular_name' => _x('Категория', 'taxonomy singular name'), 'search_items' => __('Поиск категории'), 'all_items' => __('Все категории'), 'parent_item' => __('Родительская категория'), 'parent_item_colon' => __('Родительская категория:'), 'edit_item' => __('Редактировать категорию'), 'update_item' => __('Обновить категорию'), 'add_new_item' => __('Добавить новую категорию'), 'new_item_name' => __('Новая категория'));
    register_taxonomy('adscategory', 'ads', array('public' => true, 'hierarchical' => true, 'labels' => $labelsAdsCat, 'query_var' => 'adscategory', 'show_ui' => true, 'rewrite' => array('slug' => 'adscategory', 'with_front' => false)));
    $labelsCatalogCat = array('name' => _x('Разделы справочника', 'taxonomy general name'), 'singular_name' => _x('Раздел', 'taxonomy singular name'), 'search_items' => __('Поиск разделов'), 'all_items' => __('Все разделы'), 'parent_item' => __('Родительский раздел'), 'parent_item_colon' => __('Родительский раздел:'), 'edit_item' => __('Редактировать раздел'), 'update_item' => __('Обновить раздел'), 'add_new_item' => __('Добавить новый раздел'), 'new_item_name' => __('Новый раздел'));
    register_taxonomy('catcategory', 'catalog', array('public' => true, 'hierarchical' => true, 'labels' => $labelsCatalogCat, 'query_var' => 'catcategory', 'show_ui' => true, 'rewrite' => array('slug' => 'catcategory', 'with_front' => false)));
    $labelsMedicalNewsCat = array('name' => _x('Тип', 'taxonomy general name'), 'singular_name' => _x('Тип', 'taxonomy singular name'), 'search_items' => __('Поиск типов'), 'all_items' => __('Все типы'), 'parent_item' => __('Родительский пункт'), 'parent_item_colon' => __('Родительский пункт:'), 'edit_item' => __('Редактировать'), 'update_item' => __('Обновить'), 'add_new_item' => __('Добавить новый'), 'new_item_name' => __('Новый'));
    register_taxonomy('medcat', 'medicalnews', array('public' => true, 'hierarchical' => true, 'show_in_nav_menus' => false, 'labels' => $labelsMedicalNewsCat, 'query_var' => 'medcat', 'show_ui' => true, 'rewrite' => array('slug' => 'medcat', 'with_front' => false)));
    $labelsSomCat = array('name' => _x('Разделы', 'taxonomy general name'), 'singular_name' => _x('Раздел', 'taxonomy singular name'), 'search_items' => __('Поиск разделов'), 'all_items' => __('Все разделы'), 'parent_item' => __('Родительский пункт'), 'parent_item_colon' => __('Родительский пункт:'), 'edit_item' => __('Редактировать'), 'update_item' => __('Обновить'), 'add_new_item' => __('Добавить новый'), 'new_item_name' => __('Новый'));
    register_taxonomy('somcat', 'som', array('public' => true, 'hierarchical' => true, 'show_in_nav_menus' => false, 'labels' => $labelsSomCat, 'query_var' => 'somcat', 'show_ui' => true, 'rewrite' => array('slug' => 'somcat', 'with_front' => false)));
}
コード例 #26
0
ファイル: functions.php プロジェクト: rictocco/cardiosalud
function healing_touch_font_url()
{
    $font_url = '';
    /* Translators: If there are any character that are
     * not supported by Roboto, translate this to off, do not
     * translate into your own language.
     */
    $roboto = _x('on', 'Roboto font:on or off', 'healing-touch');
    /* Translators: If there are any character that are not
     * supported by Oswald, trsnalate this to off, do not
     * translate into your own language.
     */
    $oswald = _x('on', 'Oswald:on or off', 'healing-touch');
    /* Translators: If there has any character that are not supported 
     *  by Scada, translate this to off, do not translate
     *  into your own language.
     */
    $scada = _x('on', 'Scada:on or off', 'healing-touch');
    if ('off' !== $roboto || 'off' !== $oswald) {
        $font_family = array();
        if ('off' !== $roboto) {
            $font_family[] = 'Roboto:300,400,600,700,800,900';
        }
        if ('off' !== $oswald) {
            $font_family[] = 'Oswald:300,400,600,700';
        }
        if ('off' !== $scada) {
            $font_family[] = 'Scada:300,400,600,700';
        }
        $query_args = array('family' => urlencode(implode('|', $font_family)));
        $font_url = add_query_arg($query_args, '//fonts.googleapis.com/css');
    }
    return $font_url;
}
コード例 #27
0
ファイル: slider.php プロジェクト: craighays/nsfhp
 /**
  * Register Custom Post Type
  *
  * @since 1.0.0
  */
 public function wpl_sliders_cpt()
 {
     $labels = array('name' => _x($this->wpl_get_name_plural(), 'Post Type General Name', 'charitylife-toolskit'), 'singular_name' => _x($this->wpl_get_name_singular(), 'Post Type Singular Name', 'charitylife-toolskit'), 'menu_name' => __($this->wpl_get_name_singular(), 'charitylife-toolskit'), 'name_admin_bar' => __($this->wpl_get_name_singular(), 'charitylife-toolskit'), 'parent_item_colon' => __('Parent Item:', 'charitylife-toolskit'), 'all_items' => __('All  ' . $this->wpl_get_name_plural(), 'charitylife-toolskit'), 'add_new_item' => __('Add New ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'add_new' => __('Add ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'new_item' => __('New ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'edit_item' => __('Edit ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'update_item' => __('Update ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'view_item' => __('View ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'search_items' => __('Search ' . $this->wpl_get_name_singular(), 'charitylife-toolskit'), 'not_found' => __('Not found', 'charitylife-toolskit'), 'not_found_in_trash' => __('Not found in Trash', 'charitylife-toolskit'));
     $rewrite = array('slug' => $this->wpl_get_rewrite_url(), 'with_front' => true, 'pages' => true, 'feeds' => false);
     $args = array('label' => __($this->wpl_get_name_singular(), 'charitylife-toolskit'), 'description' => __($this->wpl_get_name_singular() . ' description.', 'charitylife-toolskit'), 'labels' => $labels, 'supports' => array('title', 'excerpt'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_icon' => 'dashicons-slides', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page');
     register_post_type('post_sliders', $args);
 }
コード例 #28
0
ファイル: glossary-entry.php プロジェクト: ramiy/GlotPress-WP
 private function setup_pos()
 {
     if (!empty($this->parts_of_speech)) {
         return;
     }
     $this->parts_of_speech = array('noun' => _x('noun', 'part-of-speech', 'glotpress'), 'verb' => _x('verb', 'part-of-speech', 'glotpress'), 'adjective' => _x('adjective', 'part-of-speech', 'glotpress'), 'adverb' => _x('adverb', 'part-of-speech', 'glotpress'), 'interjection' => _x('interjection', 'part-of-speech', 'glotpress'), 'conjunction' => _x('conjunction', 'part-of-speech', 'glotpress'), 'preposition' => _x('preposition', 'part-of-speech', 'glotpress'), 'pronoun' => _x('pronoun', 'part-of-speech', 'glotpress'), 'expression' => _x('expression', 'part-of-speech', 'glotpress'));
 }
コード例 #29
0
ファイル: sidebars.php プロジェクト: jacko5/bjj
/**
 * Returns an array of the core framework's available sidebars for use in themes.  We'll just set the 
 * ID (array keys), name, and description of each sidebar.  The other sidebar arguments will be set when the 
 * sidebar is registered.
 *
 * @since 1.2.0
 * @access private
 * @return array $sidebars All the available framework sidebars.
 */
function hybrid_get_sidebars()
{
    /* Set up an array of sidebars. */
    $sidebars = array('primary' => array('name' => _x('Primary', 'sidebar', 'hybrid-core'), 'description' => __('The main (primary) widget area, most often used as a sidebar.', 'hybrid-core')), 'secondary' => array('name' => _x('Secondary', 'sidebar', 'hybrid-core'), 'description' => __('The second most important widget area, most often used as a secondary sidebar.', 'hybrid-core')), 'subsidiary' => array('name' => _x('Subsidiary', 'sidebar', 'hybrid-core'), 'description' => __('A widget area loaded in the footer of the site.', 'hybrid-core')), 'header' => array('name' => _x('Header', 'sidebar', 'hybrid-core'), 'description' => __("Displayed within the site's header area.", 'hybrid-core')), 'before-content' => array('name' => _x('Before Content', 'sidebar', 'hybrid-core'), 'description' => __("Loaded before the page's main content area.", 'hybrid-core')), 'after-content' => array('name' => _x('After Content', 'sidebar', 'hybrid-core'), 'description' => __("Loaded after the page's main content area.", 'hybrid-core')), 'after-singular' => array('name' => _x('After Singular', 'sidebar', 'hybrid-core'), 'description' => __('Loaded on singular post (page, attachment, etc.) views before the comments area.', 'hybrid-core')));
    /* Return the sidebars. */
    return $sidebars;
}
コード例 #30
0
ファイル: functions.php プロジェクト: cumi/pressbooks
function pressbooks_publisher_fonts_url()
{
    $fonts_url = '';
    /* Translators: If there are characters in your language that are not
     * supported by Oswald, translate this to 'off'. Do not translate
     * into your own language.
     */
    $oswald = _x('on', 'Oswald font: on or off', 'pressbooks');
    /* Translators: If there are characters in your language that are not
     * supported by Droid Serif, translate this to 'off'. Do not translate
     * into your own language.
     */
    $droid_serif = _x('on', 'Droid Serif font: on or off', 'pressbooks');
    /* Translators: If there are characters in your language that are not
     * supported by Droid Sans, translate this to 'off'. Do not translate
     * into your own language.
     */
    $droid_sans = _x('on', 'Droid Sans font: on or off', 'pressbooks');
    if ('off' !== $oswald || 'off' !== $droid_serif || 'off' !== $droid_sans) {
        $font_families = array();
        if ('off' !== $oswald) {
            $font_families[] = 'Oswald';
        }
        if ('off' !== $droid_serif) {
            $font_families[] = 'Droid+Serif:400,400italic,700';
        }
        if ('off' !== $droid_sans) {
            $font_families[] = 'Droid+Sans';
        }
        $query_args = array('family' => urlencode(implode('|', $font_families)), 'subset' => urlencode('latin,latin-ext'));
        $fonts_url = add_query_arg($query_args, '//fonts.googleapis.com/css');
    }
    return $fonts_url;
}