本文整理汇总了PHP中_deprecated_function函数的典型用法代码示例。如果您正苦于以下问题:PHP _deprecated_function函数的具体用法?PHP _deprecated_function怎么用?PHP _deprecated_function使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_deprecated_function函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gridSavePostSettings
/**
* Set page meta box values with vc_adv_pager shortcodes data
* @since 4.4
* @deprecated 4.4.3
*
* @param array $settings
* @param $post_id
* @param $post
*
* @return array - shortcode settings to save.
*/
public function gridSavePostSettings(array $settings, $post_id, $post)
{
_deprecated_function('Vc_Hooks_Vc_Grid: gridSavePostSettings method', '4.4.3', 'gridSavePostSettingsId');
$pattern = $this->getShortcodeRegexForHash();
preg_match_all("/{$pattern}/", $post->post_content, $found);
// fetch only needed shortcodes
$settings['vc_grid'] = array();
if (is_array($found) && !empty($found[0])) {
$to_save = array();
if (isset($found[3]) && is_array($found[3])) {
foreach ($found[3] as $key => $shortcode_atts) {
if (false !== strpos($shortcode_atts, 'vc_gid:')) {
continue;
}
$atts = shortcode_parse_atts($shortcode_atts);
$data = array('tag' => $found[2][$key], 'atts' => $atts, 'content' => $found[5][$key]);
$hash = sha1(serialize($data));
$to_save[$hash] = $data;
}
}
if (!empty($to_save)) {
$settings['vc_grid'] = array('shortcodes' => $to_save);
}
}
return $settings;
}
示例2: bp_core_set_charset
/**
* Get the DB schema to use for BuddyPress components.
*
* @since 1.1.0
* @deprecated 2.7.0
*
* @return string The default database character-set, if set.
*/
function bp_core_set_charset()
{
global $wpdb;
_deprecated_function(__FUNCTION__, '2.7', 'wpdb::get_charset_collate()');
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
return !empty($wpdb->charset) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
}
示例3: bp_activity_get_sitewide
/**
* Retrieve sitewide activity
*
* You should use bp_activity_get() instead
*
* @since 1.0.0
* @deprecated 1.2.0
*
* @param array $args
*
* @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
*
* @return object $activity The activity/activities object
*/
function bp_activity_get_sitewide($args = '')
{
_deprecated_function(__FUNCTION__, '1.2', 'bp_activity_get()');
$defaults = array('max' => false, 'page' => 1, 'per_page' => false, 'sort' => 'DESC', 'display_comments' => false, 'search_terms' => false, 'show_hidden' => false, 'filter' => array());
$args = wp_parse_args($args, $defaults);
return apply_filters('bp_activity_get_sitewide', BP_Activity_Activity::get($args), $r);
}
示例4: handle_deprecation
public static function handle_deprecation($data)
{
// determine the current filter
$current_filter = current_filter();
// figure out if the current filter is actually in our map list
if (isset(self::$map[$current_filter])) {
// get a list of this function call's args, for use when calling deprecated filters
$args = func_get_args();
array_unshift($args, null);
// get the list of all the potential old filters
$old_filters = (array) self::$map[$current_filter];
// for each matching old filter we have..
foreach ($old_filters as $old_filter_info) {
list($old_filter, $deprecation_version) = $old_filter_info;
// if there is a register function on that old filter
if (has_action($old_filter)) {
// then call those register functions
$args[0] = $old_filter;
$data = call_user_func_array('apply_filters', $args);
// pop the deprecation message
_deprecated_function(sprintf(__('The "%s" filter', 'opentickets-community-edition'), $old_filter), $deprecation_version, sprintf(__('The "%s" filter', 'opentickets-community-edition'), $current_filter));
}
}
}
return $data;
}
示例5: bp_core_referrer
/**
* Return the referrer URL without the http(s)://
*
* @deprecated 2.3.0
*
* @return string The referrer URL.
*/
function bp_core_referrer()
{
_deprecated_function(__FUNCTION__, '2.3.0', 'bp_get_referer_path()');
$referer = explode('/', wp_get_referer());
unset($referer[0], $referer[1], $referer[2]);
return implode('/', $referer);
}
示例6: tarski_doctitle
/**
* Returns the document title.
*
* The order (site name first or last) can be set on the Tarski Options page.
* While the function ultimately returns a string, please note that filters
* are applied to an array! This allows plugins to easily alter any aspect
* of the title. For example, one might write a plugin to change the separator.
*
* @since 1.5
* @deprecated 3.2.0
*
* @param string $sep
* @return string
*
* @hook filter tarski_doctitle
* Filter document titles.
*/
function tarski_doctitle($sep = '·')
{
_deprecated_function('wp_title', '3.2.0');
$site_name = get_bloginfo('name');
$content = trim(wp_title('', false));
if (is_404()) {
$content = sprintf(__('Error %s', 'tarski'), '404');
} elseif (get_option('show_on_front') == 'posts' && is_home()) {
$content = get_bloginfo('description', 'display');
} elseif (is_search()) {
$content = sprintf(__('Search results for %s', 'tarski'), esc_html(get_search_query()));
} elseif (is_month()) {
$content = single_month_title(' ', false);
} elseif (is_tag()) {
$content = multiple_tag_titles();
}
$elements = strlen($content) > 0 ? array('site_name' => $site_name, 'separator' => $sep, 'content' => $content) : array('site_name' => $site_name);
if (get_tarski_option('swap_title_order')) {
$elements = array_reverse($elements, true);
}
// Filters should return an array
$elements = apply_filters('tarski_doctitle', $elements);
// But if they don't, it won't try to implode
if (is_array($elements)) {
$doctitle = implode(' ', $elements);
}
echo $doctitle;
}
示例7: admin_styles
/**
* Enqueue styles
*/
public function admin_styles()
{
global $wp_scripts;
// Sitewide menu CSS
wp_enqueue_style('woocommerce_admin_menu_styles', WC()->plugin_url() . '/assets/css/menu.css', array(), WC_VERSION);
$screen = get_current_screen();
if (in_array($screen->id, wc_get_screen_ids())) {
$jquery_version = isset($wp_scripts->registered['jquery-ui-core']->ver) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
// Admin styles for WC pages only
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION);
wp_enqueue_style('jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version);
wp_enqueue_style('wp-color-picker');
}
if (in_array($screen->id, array('dashboard'))) {
wp_enqueue_style('woocommerce_admin_dashboard_styles', WC()->plugin_url() . '/assets/css/dashboard.css', array(), WC_VERSION);
}
if (in_array($screen->id, array('woocommerce_page_wc-reports', 'toplevel_page_wc-reports'))) {
wp_enqueue_style('woocommerce_admin_print_reports_styles', WC()->plugin_url() . '/assets/css/reports-print.css', array(), WC_VERSION, 'print');
}
/**
* @deprecated 2.3
*/
if (has_action('woocommerce_admin_css')) {
do_action('woocommerce_admin_css');
_deprecated_function('The woocommerce_admin_css action', '2.3', 'admin_enqueue_scripts');
}
}
示例8: mc4wp_get_api
/**
* Gets the MailChimp for WP API class and injects it with the API key
*
* @deprecated 4.0
* @use mc4wp_get_api_v3
*
* @since 1.0
* @access public
*
* @return MC4WP_API
*/
function mc4wp_get_api()
{
_deprecated_function(__FUNCTION__, '4.0', 'mc4wp_get_api_v3');
$opts = mc4wp_get_options();
$instance = new MC4WP_API($opts['api_key']);
return $instance;
}
示例9: log_app
/**
* Writes logging info to a file.
*
* @since 2.2.0
* @deprecated 3.4.0
* @deprecated Use error_log()
* @link http://www.php.net/manual/en/function.error-log.php
*
* @param string $label Type of logging
* @param string $msg Information describing logging reason.
*/
function log_app($label, $msg)
{
_deprecated_function(__FUNCTION__, '3.4', 'error_log()');
if (!empty($GLOBALS['app_logging'])) {
error_log($label . ' - ' . $msg);
}
}
示例10: wp_kses_post
/**
* Apply wp_kses to widget text
*
* @uses wp_kses_post()
*
* @param string $text
* @return string
* @since 2.0.0
* @deprecated 2.0.3
*/
public function wp_kses_post($text, $instance = null, $widget = null)
{
_deprecated_function(__METHOD__, '2.0.3');
if (bstw()->check_widget($widget) && !empty($instance)) {
$text = wp_kses_post($text);
}
return $text;
}
示例11: vc_grid_item_vc_settings_exclude
/**
* Adds grid item post type into the list of excluded post types for VC editors.
*
* @param array $list
*
* @since 4.4
* @deprecated 4.10
* @return array
*/
function vc_grid_item_vc_settings_exclude(array $list)
{
_deprecated_function('vc_grid_item_vc_settings_exclude function', '4.4 (will be removed in 4.10)');
require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php');
$vc_grid_item_editor = new Vc_Grid_Item_Editor();
$list[] = $vc_grid_item_editor->postType();
return $list;
}
示例12: get_useronline_count
function get_useronline_count($display = false)
{
_deprecated_function(__FUNCTION__, '2.70', 'users_online_count()');
if (!$display) {
return get_users_online_count();
}
users_online_count();
}
示例13: get_options
/**
* Get all options for the Events Calendar
*
* @return array of options
*/
public static function get_options()
{
$options = get_option(Tribe__Main::OPTIONNAME, array());
if (has_filter('tribe_get_options')) {
_deprecated_function('tribe_get_options', '3.10', 'option_' . Tribe__Main::OPTIONNAME);
$options = apply_filters('tribe_get_options', $options);
}
return $options;
}
示例14: lp_deprecated_filter_mapping
function lp_deprecated_filter_mapping($data, $arg_1 = '', $arg_2 = '', $arg_3 = '')
{
global $lp_map_deprecated_filters, $wp_filter;
$filter = current_filter();
if (!empty($wp_filter[$filter]) && count($wp_filter[$filter]) > 1) {
_deprecated_function('The ' . $filter . ' hook', '1.0', $lp_map_deprecated_filters[$filter]);
}
return $data;
}
示例15: maybe_fire_array_access_deprecation_notice
private function maybe_fire_array_access_deprecation_notice($offset)
{
if (self::SUPPRESS_DEPRECATION_NOTICE) {
return;
}
if (!self::$deprecation_notice_fired) {
_deprecated_function('Array access to the field object is now deprecated. Further notices will be suppressed. Offset: ' . $offset, '1.9', 'the object operator e.g. $field->' . $offset);
self::$deprecation_notice_fired = true;
}
}