本文整理汇总了PHP中get_bloginfo函数的典型用法代码示例。如果您正苦于以下问题:PHP get_bloginfo函数的具体用法?PHP get_bloginfo怎么用?PHP get_bloginfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_bloginfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* Called on load action.
*
* @return void
*/
public static function load()
{
global $wpdb;
if (isset($_GET['action']) && $_GET['action'] == 'dbdumpdl') {
//check permissions
check_admin_referer('backwpupdbdumpdl');
if (!current_user_can('backwpup_jobs_edit')) {
die;
}
//doing dump
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream; charset=" . get_bloginfo('charset'));
header("Content-Disposition: attachment; filename=" . DB_NAME . ".sql;");
try {
$sql_dump = new BackWPup_MySQLDump();
foreach ($sql_dump->tables_to_dump as $key => $table) {
if ($wpdb->prefix != substr($table, 0, strlen($wpdb->prefix))) {
unset($sql_dump->tables_to_dump[$key]);
}
}
$sql_dump->execute();
unset($sql_dump);
} catch (Exception $e) {
die($e->getMessage());
}
die;
}
}
示例2: initdb
public static function initdb()
{
$settings = SwpmSettings::get_instance();
$installed_version = $settings->get_value('swpm-active-version');
//Set other default settings values
$reg_prompt_email_subject = "Complete your registration";
$reg_prompt_email_body = "Dear {first_name} {last_name}" . "\n\nThank you for joining us!" . "\n\nPlease complete your registration by visiting the following link:" . "\n\n{reg_link}" . "\n\nThank You";
$reg_email_subject = "Your registration is complete";
$reg_email_body = "Dear {first_name} {last_name}\n\n" . "Your registration is now complete!\n\n" . "Registration details:\n" . "Username: {user_name}\n" . "Password: {password}\n\n" . "Please login to the member area at the following URL:\n\n" . "{login_link}\n\n" . "Thank You";
$upgrade_email_subject = "Subject for email sent after account upgrade";
$upgrade_email_body = "Dear {first_name} {last_name}" . "\n\nYour Account Has Been Upgraded." . "\n\nThank You";
$reset_email_subject = get_bloginfo('name') . ": New Password";
$reset_email_body = "Dear {first_name} {last_name}" . "\n\nHere is your new password:" . "\n\nUsername: {user_name}" . "\nPassword: {password}" . "\n\nYou can change the password from the edit profile section of the site (after you log into the site)" . "\n\nThank You";
$status_change_email_subject = "Account Updated!";
$status_change_email_body = "Dear {first_name} {last_name}," . "\n\nYour account status has been updated!" . " Please login to the member area at the following URL:" . "\n\n {login_link}" . "\n\nThank You";
$bulk_activate_email_subject = "Account Activated!";
$bulk_activate_email_body = "Hi," . "\n\nYour account has been activated!" . "\n\nYou can now login to the member area." . "\n\nThank You";
if (empty($installed_version)) {
//Do fresh install tasks
//Create the mandatory pages (if they are not there)
SwpmMiscUtils::create_mandatory_wp_pages();
//End of page creation
$settings->set_value('reg-complete-mail-subject', stripslashes($reg_email_subject))->set_value('reg-complete-mail-body', stripslashes($reg_email_body))->set_value('reg-prompt-complete-mail-subject', stripslashes($reg_prompt_email_subject))->set_value('reg-prompt-complete-mail-body', stripslashes($reg_prompt_email_body))->set_value('upgrade-complete-mail-subject', stripslashes($upgrade_email_subject))->set_value('upgrade-complete-mail-body', stripslashes($upgrade_email_body))->set_value('reset-mail-subject', stripslashes($reset_email_subject))->set_value('reset-mail-body', stripslashes($reset_email_body))->set_value('account-change-email-subject', stripslashes($status_change_email_subject))->set_value('account-change-email-body', stripslashes($status_change_email_body))->set_value('email-from', trim(get_option('admin_email')));
$settings->set_value('bulk-activate-notify-mail-subject', stripslashes($bulk_activate_email_subject));
$settings->set_value('bulk-activate-notify-mail-body', stripslashes($bulk_activate_email_body));
}
if (version_compare($installed_version, SIMPLE_WP_MEMBERSHIP_VER) == -1) {
//Do upgrade tasks
}
$settings->set_value('swpm-active-version', SIMPLE_WP_MEMBERSHIP_VER)->save();
//save everything.
}
示例3: um_add_user_frontend
function um_add_user_frontend($args)
{
global $ultimatemember;
extract($args);
if (isset($user_email) && !isset($user_login)) {
$user_login = $user_email;
}
if (isset($username) && !isset($args['user_login'])) {
$user_login = $username;
}
if (isset($username) && is_email($username)) {
$user_email = $username;
}
if (!isset($user_password)) {
$user_password = $ultimatemember->validation->generate();
}
$unique_userID = $ultimatemember->query->count_users() + 1;
if (!isset($user_email)) {
$user_email = 'nobody' . $unique_userID . '@' . get_bloginfo('name');
}
if (!isset($user_login)) {
$user_login = 'user' . $unique_userID;
}
$creds['user_login'] = $user_login;
$creds['user_password'] = $user_password;
$creds['user_email'] = $user_email;
$args['submitted'] = array_merge($args['submitted'], $creds);
$args = array_merge($args, $creds);
do_action('um_before_new_user_register', $args);
$user_id = wp_create_user($user_login, $user_password, $user_email);
do_action('um_after_new_user_register', $user_id, $args);
return $user_id;
}
示例4: _get_phpdoc_data
/**
* Generate the data from the PHPDoc markup.
*
* @param string $path Directory or file to scan for PHPDoc
* @param string $format What format the data is returned in: [json|array].
*
* @return string|array
*/
protected function _get_phpdoc_data($path, $format = 'json')
{
$output_cache_file = dirname(__DIR__) . '/cache-phpdoc.json';
/**
* Force delete last cache of phpdoc
* Compare directory and WordPress Version for detecting
*/
$delete_output_cache_file = false;
$wp_parser_root_import_dir = get_option('wp_parser_root_import_dir', '');
$directory_to_compare = wp_normalize_path(__DIR__);
if (false !== strpos($wp_parser_root_import_dir, $directory_to_compare)) {
$current_wp_version = get_bloginfo('version');
$wp_parser_imported_wp_version = get_option('wp_parser_imported_wp_version', $current_wp_version);
$delete_output_cache_file = $wp_parser_imported_wp_version != $current_wp_version;
}
/**
* Delete last cache of phpdoc, true for deleting or false to skip
*
* Default: false or compare wordpress version see above
*/
$delete_output_cache_file = apply_filters('sublime_delete_phpdoc_output_cache', $delete_output_cache_file);
if ($delete_output_cache_file) {
if (false !== stream_resolve_include_path($output_cache_file)) {
unlink($output_cache_file);
}
}
if (false !== stream_resolve_include_path($output_cache_file)) {
if ($output = file_get_contents($output_cache_file)) {
$output = 'json' == $format ? $output : json_decode($output, true);
}
} else {
WP_CLI::line(sprintf('Extracting PHPDoc from %s. This may take a few minutes...', $path));
$is_file = is_file($path);
$files = $is_file ? array($path) : Importer::set_parser_phpdoc($path);
$path = $is_file ? dirname($path) : $path;
if ($files instanceof WP_Error) {
WP_CLI::error(sprintf('Problem with %1$s: %2$s', $path, $files->get_error_message()));
exit;
}
$output = Importer::get_parser_phpdoc($files, $path);
/**
* Generate cache file from phpdoc, true for generate or false to skip
*
* Default: true
*/
if (apply_filters('sublime_create_phpdoc_output_cache', true)) {
file_put_contents($output_cache_file, json_encode($output, JSON_PRETTY_PRINT));
}
if ('json' == $format) {
$output = json_encode($output, JSON_PRETTY_PRINT);
}
}
if ($helper_directory = realpath(dirname(__DIR__) . '/missing')) {
$helpers = glob($helper_directory . '/*.php');
if (is_array($helpers)) {
$output = array_merge($output, Importer::get_parser_phpdoc($helpers, $helper_directory));
}
}
return $output;
}
示例5: themepark_remove_cssjs_ver
function themepark_remove_cssjs_ver($src)
{
if (strpos($src, 'ver=' . get_bloginfo('version'))) {
$src = remove_query_arg('ver', $src);
}
return $src;
}
示例6: constant
public function constant($mm_config = array())
{
// Set theme primary information.
foreach ($mm_config as $key => $value) {
$this->constant[$key] = $value;
}
// Set theme identificators and prefixes.
$this->constant['MM_OPTIONS_NAME'] = $this->constant['MM_WARE_SLUG'] . '_options';
$this->constant['MM_OPTIONS_DB_NAME'] = $this->constant['MM_OPTIONS_NAME'];
$this->constant['MM_TEXTDOMAIN'] = $this->constant['MM_WARE_SLUG'];
$this->constant['MM_TEXTDOMAIN_ADMIN'] = $this->constant['MM_WARE_SLUG'] . '_admin';
$this->constant['MM_THEME_PAGE_SLUG'] = $this->constant['MM_OPTIONS_NAME'];
// Set theme static locations.
// DIRECTORIES
$this->constant['MM_WARE_DIR'] = dirname($this->constant['MM_WARE_INIT_FILE']);
$this->constant['MM_WARE_FRAMEWORK_DIR'] = $this->constant['MM_WARE_DIR'] . '/framework';
$this->constant['MM_WARE_EXTENSIONS_DIR'] = $this->constant['MM_WARE_DIR'] . '/extensions';
$this->constant['MM_WARE_SRC_DIR'] = $this->constant['MM_WARE_DIR'] . '/src';
$this->constant['MM_WARE_CSS_DIR'] = $this->constant['MM_WARE_SRC_DIR'] . '/css';
// URL's
if (is_multisite()) {
$home_url = get_home_url();
} else {
$wpurl = get_bloginfo('wpurl');
$home_url = $wpurl;
}
$ware_dir_explode = array_reverse(explode('/', str_replace('\\', '/', $this->constant['MM_WARE_DIR'])));
$this->constant['MM_WARE_URL'] = $home_url . '/' . $ware_dir_explode[2] . '/' . $ware_dir_explode[1] . '/' . $ware_dir_explode[0];
$this->constant['MM_WARE_SRC_URL'] = $this->constant['MM_WARE_URL'] . '/src';
$this->constant['MM_WARE_CSS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/css';
$this->constant['MM_WARE_JS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/js';
$this->constant['MM_WARE_FONTS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/fonts';
$this->constant['MM_WARE_IMG_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/img';
}
示例7: to_json
/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @since 3.4.0
* @since 4.2.0 Moved from WP_Customize_Upload_Control.
*
* @see WP_Customize_Control::to_json()
*/
public function to_json()
{
parent::to_json();
$this->json['label'] = html_entity_decode($this->label, ENT_QUOTES, get_bloginfo('charset'));
$this->json['mime_type'] = $this->mime_type;
$this->json['button_labels'] = $this->button_labels;
$this->json['canUpload'] = current_user_can('upload_files');
$value = $this->value();
if (is_object($this->setting)) {
if ($this->setting->default) {
// Fake an attachment model - needs all fields used by template.
// Note that the default value must be a URL, NOT an attachment ID.
$type = in_array(substr($this->setting->default, -3), array('jpg', 'png', 'gif', 'bmp')) ? 'image' : 'document';
$default_attachment = array('id' => 1, 'url' => $this->setting->default, 'type' => $type, 'icon' => wp_mime_type_icon($type), 'title' => basename($this->setting->default));
if ('image' === $type) {
$default_attachment['sizes'] = array('full' => array('url' => $this->setting->default));
}
$this->json['defaultAttachment'] = $default_attachment;
}
if ($value && $this->setting->default && $value === $this->setting->default) {
// Set the default as the attachment.
$this->json['attachment'] = $this->json['defaultAttachment'];
} elseif ($value) {
$this->json['attachment'] = wp_prepare_attachment_for_js($value);
}
}
}
示例8: __construct
/**
* Constructor
*/
public function __construct()
{
$remove = array_diff(array_keys($_GET), $this->baseUrlParamNames);
if ($remove) {
$this->baseUrl = remove_query_arg($remove);
} else {
$this->baseUrl = $_SERVER['REQUEST_URI'];
}
parent::__construct();
// add special filter for url fields
$this->input->addFilter(create_function('$str', 'return "http://" == $str || "ftp://" == $str ? "" : $str;'));
// enqueue required sripts and styles
global $wp_styles;
if (!is_a($wp_styles, 'WP_Styles')) {
$wp_styles = new WP_Styles();
}
wp_enqueue_style('pmwi-admin-style', PMWI_ROOT_URL . '/static/css/admin.css', array(), PMWI_VERSION);
if (version_compare(get_bloginfo('version'), '3.8-RC1') >= 0) {
wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_ROOT_URL . '/static/css/admin-wp-3.8.css');
}
wp_enqueue_script('pmwi-script', PMWI_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
wp_enqueue_script('pmwi-admin-script', PMWI_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'), PMWI_VERSION);
global $woocommerce;
$woocommerce_witepanel_params = array('remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'wpai_woocommerce_addon_plugin'), 'remove_attribute' => __('Remove this attribute?', 'wpai_woocommerce_addon_plugin'), 'name_label' => __('Name', 'wpai_woocommerce_addon_plugin'), 'remove_label' => __('Remove', 'wpai_woocommerce_addon_plugin'), 'click_to_toggle' => __('Click to toggle', 'wpai_woocommerce_addon_plugin'), 'values_label' => __('Value(s)', 'wpai_woocommerce_addon_plugin'), 'text_attribute_tip' => __('Enter some text, or some attributes by pipe (|) separating values.', 'wpai_woocommerce_addon_plugin'), 'visible_label' => __('Visible on the product page', 'wpai_woocommerce_addon_plugin'), 'used_for_variations_label' => __('Used for variations', 'wpai_woocommerce_addon_plugin'), 'new_attribute_prompt' => __('Enter a name for the new attribute term:', 'wpai_woocommerce_addon_plugin'), 'calc_totals' => __("Calculate totals based on order items, discount amount, and shipping? Note, you will need to (optionally) calculate tax rows and cart discounts manually.", 'wpai_woocommerce_addon_plugin'), 'calc_line_taxes' => __("Calculate line taxes? This will calculate taxes based on the customers country. If no billing/shipping is set it will use the store base country.", 'wpai_woocommerce_addon_plugin'), 'copy_billing' => __("Copy billing information to shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'load_billing' => __("Load the customer's billing information? This will remove any currently entered billing information.", 'wpai_woocommerce_addon_plugin'), 'load_shipping' => __("Load the customer's shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'featured_label' => __('Featured', 'wpai_woocommerce_addon_plugin'), 'tax_or_vat' => $woocommerce->countries->tax_or_vat(), 'prices_include_tax' => get_option('woocommerce_prices_include_tax'), 'round_at_subtotal' => get_option('woocommerce_tax_round_at_subtotal'), 'meta_name' => __('Meta Name', 'wpai_woocommerce_addon_plugin'), 'meta_value' => __('Meta Value', 'wpai_woocommerce_addon_plugin'), 'no_customer_selected' => __('No customer selected', 'wpai_woocommerce_addon_plugin'), 'tax_label' => __('Tax Label:', 'wpai_woocommerce_addon_plugin'), 'compound_label' => __('Compound:', 'wpai_woocommerce_addon_plugin'), 'cart_tax_label' => __('Cart Tax:', 'wpai_woocommerce_addon_plugin'), 'shipping_tax_label' => __('Shipping Tax:', 'wpai_woocommerce_addon_plugin'), 'plugin_url' => $woocommerce->plugin_url(), 'ajax_url' => admin_url('admin-ajax.php'), 'add_order_item_nonce' => wp_create_nonce("add-order-item"), 'add_attribute_nonce' => wp_create_nonce("add-attribute"), 'calc_totals_nonce' => wp_create_nonce("calc-totals"), 'get_customer_details_nonce' => wp_create_nonce("get-customer-details"), 'search_products_nonce' => wp_create_nonce("search-products"), 'calendar_image' => $woocommerce->plugin_url() . '/assets/images/calendar.png', 'post_id' => null);
wp_localize_script('woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params);
wp_enqueue_style('pmwi-woo-style', $woocommerce->plugin_url() . '/assets/css/admin.css');
}
示例9: compo_cloud
function compo_cloud()
{
global $wpdb;
$topurl = get_bloginfo("url");
$start = 10;
$total = 24;
$query = "SELECT {$wpdb->terms}.term_id, {$wpdb->terms}.name, {$wpdb->term_taxonomy}.count, {$wpdb->terms}.slug FROM (({$wpdb->term_relationships} INNER JOIN {$wpdb->posts} ON {$wpdb->term_relationships}.object_id = {$wpdb->posts}.ID) INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id) INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id WHERE ((({$wpdb->term_taxonomy}.taxonomy)='post_tag') AND (({$wpdb->posts}.post_status)='publish')) GROUP BY {$wpdb->terms}.name ORDER BY count DESC, {$wpdb->terms}.name";
# LIMIT $start,$total";
$terms = $wpdb->get_results($query);
shuffle($terms);
$data = array();
foreach ($terms as $e) {
if ($e->count < 2) {
continue;
}
$data[] = "{$e->count}|{$e->name}|{$e->slug}";
if (count($data) >= $total) {
break;
}
}
natcasesort($data);
$out = array();
$n = 0;
foreach ($data as $v) {
$z = intval(8 + $n * 0.5);
list($x, $name, $slug) = explode("|", $v);
// $name = htmlentities($name);
$out[] = "<a href='{$topurl}/tag/{$slug}' style='font-size:{$z}px'>{$name}</a>";
$n += 1;
}
shuffle($out);
echo implode(" ", $out);
}
示例10: tography_lite_enqueue_stylesheets
function tography_lite_enqueue_stylesheets()
{
//Bootstrap =======================================================
wp_register_style('bootstrap', TOGRAPHY_LITE_CSS . '/bootstrap.css', array(), '3.1', 'all');
wp_enqueue_style('bootstrap');
//=================================================================
if (is_page_template('page-portfolio-thirds.php') || is_archive()) {
//Isotope ================================================
wp_register_style('isotope', TOGRAPHY_LITE_CSS . '/isotope.css', array(), '1.0', 'all');
wp_enqueue_style('isotope');
//=================================================================
//Photoswipe ======================================================
wp_register_style('photoswipe', TOGRAPHY_LITE_CSS . '/photoswipe.css', array(), '2.0.0', 'all');
wp_enqueue_style('photoswipe');
//=================================================================
//Photoswipe Skin ======================================================
wp_register_style('photoswipe-skin', TOGRAPHY_LITE_CSS . '/default-skin/default-skin.css', array(), '2.0.0', 'all');
wp_enqueue_style('photoswipe-skin');
//=================================================================
}
if (is_single() || is_archive()) {
//Photoswipe ======================================================
wp_register_style('photoswipe', TOGRAPHY_LITE_CSS . '/photoswipe.css', array(), '2.0.0', 'all');
wp_enqueue_style('photoswipe');
//=================================================================
//Photoswipe Skin ======================================================
wp_register_style('photoswipe-skin', TOGRAPHY_LITE_CSS . '/default-skin/default-skin.css', array(), '2.0.0', 'all');
wp_enqueue_style('photoswipe-skin');
//=================================================================
}
//Main Stylesheet =================================================
wp_register_style('main-stylesheet', get_bloginfo('stylesheet_url'), array('bootstrap'), '1.0', 'all');
wp_enqueue_style('main-stylesheet');
//=================================================================
}
示例11: amazingtimes_enqueue_styles
function amazingtimes_enqueue_styles()
{
wp_enqueue_style('amazingtimes-lato-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic', array(), CHILD_THEME_VERSION);
wp_enqueue_style('amazingtimes-gvollkorn-fonts', '//fonts.googleapis.com/css?family=Vollkorn:400italic,700italic,400,700', array(), CHILD_THEME_VERSION);
wp_enqueue_script('amazingtimes-responsive-menu', get_bloginfo('stylesheet_directory') . '/js/responsive-menu.js', array('jquery'), '1.0.0');
wp_enqueue_style('dashicons');
}
示例12: cultiv8_customize_register
/**
* 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’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')));
}
}
示例13: display_clink_main_slug
function display_clink_main_slug()
{
// validate and update clink_main_slug value
$clink_main_slug_option = get_option('clink_main_slug');
if ($clink_main_slug_option) {
$clink_main_slug_option = str_replace(' ', '-', $clink_main_slug_option);
// Replaces all spaces with hyphens.
$clink_main_slug_option = preg_replace('/[^A-Za-z0-9\\-]/', '', $clink_main_slug_option);
// Removes special chars.
update_option('clink_main_slug', $value = $clink_main_slug_option);
$clink_main_slug_option = get_option('clink_main_slug');
} elseif (empty($clink_main_slug_option)) {
update_option('clink_main_slug', $value = 'clink');
$clink_main_slug_option = get_option('clink_main_slug');
}
// Flush rewrite rules after Clink settings update
if (isset($_GET['settings-updated'])) {
flush_rewrite_rules();
}
$clink_slug_structure = get_bloginfo('url') . '/' . $clink_main_slug_option . '/link-name';
?>
<input type="text" name="clink_main_slug" id="clink_main_slug" value="<?php
echo $clink_main_slug_option;
?>
" />
<p class="description clink-description"><?php
_e('Enter the clink plugin base slug for links. In default it set to <code>clink</code>', 'aryan-themes');
?>
</p>
<p class="description clink-description"><?php
printf(__('Current links structure is like: <code>%s</code>', 'aryan-themes'), $clink_slug_structure);
?>
</p>
<?php
}
示例14: sendContact
public function sendContact()
{
$res = new responseGmp();
$time = time();
$prevSendTime = (int) get_option(GMP_CODE . '_last__time_contact_send');
if ($prevSendTime && $time - $prevSendTime < 5 * 60) {
// Only one message per five minutes
$res->pushError(__('Please don\'t send contact requests so often - wait for response for your previous requests.'));
$res->ajaxExec();
}
$data = reqGmp::get('post');
$fields = $this->getModule()->getContactFormFields();
foreach ($fields as $fName => $fData) {
$validate = isset($fData['validate']) ? $fData['validate'] : false;
$data[$fName] = isset($data[$fName]) ? trim($data[$fName]) : '';
if ($validate) {
$error = '';
foreach ($validate as $v) {
if (!empty($error)) {
break;
}
switch ($v) {
case 'notEmpty':
if (empty($data[$fName])) {
$error = $fData['html'] == 'selectbox' ? __('Please select %s', GMP_LANG_CODE) : __('Please enter %s', GMP_LANG_CODE);
$error = sprintf($error, $fData['label']);
}
break;
case 'email':
if (!is_email($data[$fName])) {
$error = __('Please enter valid email address', GMP_LANG_CODE);
}
break;
}
if (!empty($error)) {
$res->pushError($error, $fName);
}
}
}
}
if (!$res->error()) {
$msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />';
$msg .= 'Plugin: ' . GMP_WP_PLUGIN_NAME . '<br />';
foreach ($fields as $fName => $fData) {
if (in_array($fName, array('name', 'email', 'subject'))) {
continue;
}
if ($fName == 'category') {
$data[$fName] = $fData['options'][$data[$fName]];
}
$msg .= '<b>' . $fData['label'] . '</b>: ' . nl2br($data[$fName]) . '<br />';
}
if (frameGmp::_()->getModule('mail')->send('support@supsystic.team.zendesk.com', $data['subject'], $msg, $data['name'], $data['email'])) {
update_option(GMP_CODE . '_last__time_contact_send', $time);
} else {
$res->pushError(frameGmp::_()->getModule('mail')->getMailErrors());
}
}
$res->ajaxExec();
}
示例15: dess_page_title
function dess_page_title($title)
{
if (empty($title) && (is_home() || is_front_page())) {
return __('Home', 'pro-blogg') . ' | ' . get_bloginfo('description');
}
return $title;
}