本文整理汇总了PHP中_x函数的典型用法代码示例。如果您正苦于以下问题:PHP _x函数的具体用法?PHP _x怎么用?PHP _x使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_x函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cp
/**
* 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: register_taxonomies
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: facility_post_type
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: pitch_slide_init
/**
* 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: wptexturize
/**
* 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>
* ’cause today’s effort makes it worth tomorrow’s “holiday”…
* </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('“', 'opening curly quote');
/* translators: closing curly quote */
$closing_quote = _x('”', '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("’tain’t", "’twere", "’twas", "’tis", "’twill", "’til", "’bout", "’nuff", "’round", "’cause");
}
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace);
$dynamic_characters = array('/\'(\\d\\d(?:’|\')?s)/', '/\'(\\d+)/', '/(\\s|\\A|[([{<]|")\'/', '/(\\d+)"/', '/(\\d+)\'/', '/(\\S)\'([^\'\\s])/', '/(\\s|\\A|[([{<])"(?!\\s)/', '/"(\\s|\\S|\\Z)/', '/\'([\\s.]|\\Z)/', '/\\b(\\d+)x(\\d+)\\b/');
$dynamic_replacements = array('’$1', '’$1', '$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$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};)/', '&$1', $curl);
$output .= $curl;
}
return $output;
}
示例6: wp_ajax_ajax_tag_search
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: ucfbands_cpt_location
/**
* 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: add_custom_taxonomies
/**
* 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: create_candidate_disciplines_taxonomies
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: ctfw_fields
/**
* 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: html
/**
* 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: __construct
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: get_rows
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: flexy_get_font_url
/**
* 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: wpl_toolskit_gallery_taxomomy
/**
* 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();
}