本文整理汇总了PHP中wp_stream_get_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_stream_get_meta函数的具体用法?PHP wp_stream_get_meta怎么用?PHP wp_stream_get_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_stream_get_meta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if ('wordpress' === $record->context && 'updated' === $record->action) {
global $wp_version;
$version = wp_stream_get_meta($record, 'new_version', true);
if ($version === $wp_version) {
$links[__('About', 'stream')] = admin_url('about.php?updated');
}
$links[__('View Release Notes', 'stream')] = esc_url(sprintf('http://codex.wordpress.org/Version_%s', $version));
}
return $links;
}
开发者ID:johnleesw,项目名称:mustardseedwp,代码行数:22,代码来源:class-wp-stream-connector-installer.php
示例2: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
* @param array $links Previous links registered
* @param int $record Stream record
* @return array Action links
*/
public static function action_links($links, $record)
{
if (current_user_can('edit_theme_options')) {
$file_name = wp_stream_get_meta($record->ID, 'file', true);
$theme_slug = wp_stream_get_meta($record->ID, 'theme_slug', true);
if ('' !== $file_name && '' !== $theme_slug) {
$links[__('Edit File', 'stream')] = admin_url(sprintf('theme-editor.php?theme=%s&file=%s', $theme_slug, $file_name));
$links[__('Edit Theme', 'stream')] = admin_url(sprintf('themes.php?theme=%s', $theme_slug));
}
}
return $links;
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:20,代码来源:editor.php
示例3: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
* @param array $links Previous links registered
* @param int $record Stream record
* @return array Action links
*/
public static function action_links($links, $record)
{
if ($sidebar = wp_stream_get_meta($record->ID, 'sidebar_id', true)) {
global $wp_registered_sidebars;
if (array_key_exists($sidebar, $wp_registered_sidebars)) {
$links[__('Edit Widget Area', 'stream')] = admin_url('widgets.php#' . $sidebar);
// xss ok (@todo fix WPCS rule)
}
// @todo Also old_sidebar_id and new_sidebar_id
// @todo Add Edit Widget link
}
return $links;
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:21,代码来源:widgets.php
示例4: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
* @param array $links Previous links registered
* @param int $record Stream record
* @return array Action links
*/
public static function action_links($links, $record)
{
$post = get_post($record->object_id);
if ($post && $post->post_status === wp_stream_get_meta($record->ID, 'new_status', true)) {
$post_type_name = self::get_post_type_name(get_post_type($post->ID));
if ('trash' === $post->post_status) {
$untrash = wp_nonce_url(add_query_arg(array('action' => 'untrash', 'post' => $post->ID), admin_url('post.php')), sprintf('untrash-post_%d', $post->ID));
$delete = wp_nonce_url(add_query_arg(array('action' => 'delete', 'post' => $post->ID), admin_url('post.php')), sprintf('delete-post_%d', $post->ID));
$links[sprintf(esc_html_x('Restore %s', 'Post type singular name', 'stream'), $post_type_name)] = $untrash;
$links[sprintf(esc_html_x('Delete %s Permenantly', 'Post type singular name', 'stream'), $post_type_name)] = $delete;
} else {
$links[sprintf(esc_html_x('Edit %s', 'Post type singular name', 'stream'), $post_type_name)] = get_edit_post_link($post->ID);
if ($view_link = get_permalink($post->ID)) {
$links[esc_html__('View', 'default')] = $view_link;
}
if ($revision_id = wp_stream_get_meta($record->ID, 'revision_id', true)) {
$links[esc_html__('Revision', 'default')] = get_edit_post_link($revision_id);
}
}
}
return $links;
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:30,代码来源:posts.php
示例5: metabox_save
public function metabox_save($rule)
{
$reset_link = add_query_arg(array('action' => 'stream-notifications-reset-occ', 'id' => absint($rule->ID), 'wp_stream_nonce' => wp_create_nonce('reset-occ_' . absint($rule->ID))), admin_url('admin-ajax.php'));
?>
<div class="submitbox" id="submitpost">
<div id="minor-publishing">
<div id="misc-publishing-actions">
<div class="misc-pub-section misc-pub-post-status">
<label for="notification_visibility">
<input type="checkbox" name="visibility" id="notification_visibility" value="active" <?php
checked(!$rule->exists() || 'active' === $rule->visibility);
?>
>
<?php
esc_html_e('Active', 'stream-notifications');
?>
</label>
</div>
<?php
if ($rule->exists()) {
?>
<div class="misc-pub-section">
<?php
$occ = absint(wp_stream_get_meta($rule->ID, 'occurrences', true));
?>
<div class="occurrences">
<p>
<?php
echo sprintf(_n('This rule has occurred %1$s time.', 'This rule has occurred %1$s times.', $occ, 'stream-notifications'), sprintf('<strong>%d</strong>', $occ ? $occ : 0));
?>
</p>
<?php
if (0 !== $occ) {
?>
<p>
<a href="<?php
echo esc_url($reset_link);
?>
" class="button button-secondary reset-occ">
<?php
esc_html_e('Reset Count', 'stream-notifications');
?>
</a>
</p>
<?php
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<div id="major-publishing-actions">
<?php
if ($rule->exists()) {
?>
<div id="delete-action">
<?php
$delete_link = add_query_arg(array('page' => WP_Stream_Notifications::NOTIFICATIONS_PAGE_SLUG, 'action' => 'delete', 'id' => absint($rule->ID), 'wp_stream_nonce' => wp_create_nonce('delete-record_' . absint($rule->ID))), is_network_admin() ? network_admin_url(WP_Stream_Admin::ADMIN_PARENT_PAGE) : admin_url(WP_Stream_Admin::ADMIN_PARENT_PAGE));
?>
<a class="submitdelete deletion" href="<?php
echo esc_url($delete_link);
?>
">
<?php
esc_html_e('Delete Permanently', 'stream-notifications');
?>
</a>
</div>
<?php
}
?>
<div id="publishing-action">
<span class="spinner"></span>
<input type="submit" name="publish" id="publish" class="button button-primary button-large" value="<?php
$rule->exists() ? esc_attr_e('Update', 'stream-notifications') : esc_attr_e('Save', 'stream-notifications');
?>
" accesskey="s">
</div>
<div class="clear"></div>
</div>
</div>
<?php
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:88,代码来源:form.php
示例6: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
$contexts = self::get_context_labels();
// Options
if ($option = wp_stream_get_meta($record, 'option', true)) {
$key = wp_stream_get_meta($record, 'option_key', true);
$links[__('Edit', 'default')] = add_query_arg(array('page' => $record->context), admin_url('admin.php')) . '#stream-highlight-' . esc_attr($key);
} elseif ('wpseo_files' === $record->context) {
$links[__('Edit', 'default')] = add_query_arg(array('page' => $record->context), admin_url('admin.php'));
} elseif ('wpseo_meta' === $record->context) {
$post = get_post($record->object_id);
if ($post) {
$post_type_name = WP_Stream_Connector_Posts::get_post_type_name(get_post_type($post->ID));
if ('trash' === $post->post_status) {
$untrash = wp_nonce_url(add_query_arg(array('action' => 'untrash', 'post' => $post->ID), admin_url('post.php')), sprintf('untrash-post_%d', $post->ID));
$delete = wp_nonce_url(add_query_arg(array('action' => 'delete', 'post' => $post->ID), admin_url('post.php')), sprintf('delete-post_%d', $post->ID));
$links[sprintf(esc_html_x('Restore %s', 'Post type singular name', 'stream'), $post_type_name)] = $untrash;
$links[sprintf(esc_html_x('Delete %s Permenantly', 'Post type singular name', 'stream'), $post_type_name)] = $delete;
} else {
$links[sprintf(esc_html_x('Edit %s', 'Post type singular name', 'stream'), $post_type_name)] = get_edit_post_link($post->ID);
if ($view_link = get_permalink($post->ID)) {
$links[esc_html__('View', 'default')] = $view_link;
}
if ($revision_id = wp_stream_get_meta($record, 'revision_id', true)) {
$links[esc_html__('Revision', 'default')] = get_edit_post_link($revision_id);
}
}
}
}
return $links;
}
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:41,代码来源:class-wp-stream-connector-wordpress-seo.php
示例7: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
// @todo provide proper action links
if ('jetpack' === $record->connector) {
if ('modules' === $record->context) {
$slug = wp_stream_get_meta($record, 'module_slug', true);
if (is_array($slug)) {
$slug = current($slug);
}
if (Jetpack::is_module_active($slug)) {
if (apply_filters('jetpack_module_configurable_' . $slug, false)) {
$links[__('Configure', 'stream')] = Jetpack::module_configuration_url($slug);
}
$links[__('Deactivate', 'stream')] = wp_nonce_url(add_query_arg(array('action' => 'deactivate', 'module' => $slug), Jetpack::admin_url()), 'jetpack_deactivate-' . sanitize_title($slug));
} else {
$links[__('Activate', 'stream')] = wp_nonce_url(add_query_arg(array('action' => 'activate', 'module' => $slug), Jetpack::admin_url()), 'jetpack_activate-' . sanitize_title($slug));
}
} elseif (Jetpack::is_module_active(str_replace('jetpack-', '', $record->context))) {
$slug = str_replace('jetpack-', '', $record->context);
// handling jetpack-comment anomaly
if (apply_filters('jetpack_module_configurable_' . $slug, false)) {
$links[__('Configure module', 'stream')] = Jetpack::module_configuration_url($slug);
}
}
}
return $links;
}
开发者ID:johnleesw,项目名称:mustardseedwp,代码行数:37,代码来源:class-wp-stream-connector-jetpack.php
示例8: alert
private function alert($rules, $log)
{
foreach ($rules as $rule_id => $rule) {
// Update occurrences
wp_stream_update_meta($rule_id, 'occurrences', (int) wp_stream_get_meta($rule_id, 'occurrences', true) + 1);
foreach ($rule['alerts'] as $alert) {
if (!isset(WP_Stream_Notifications::$adapters[$alert['type']])) {
continue;
}
$adapter = new WP_Stream_Notifications::$adapters[$alert['type']]['class']();
$adapter->load($alert)->send($log);
}
}
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:14,代码来源:wp-stream-notification-rule-match.php
示例9: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if (current_user_can('edit_theme_options')) {
$file_name = wp_stream_get_meta($record, 'file', true);
$file_path = wp_stream_get_meta($record, 'file_path', true);
if (!empty($file_name) && !empty($file_path)) {
$theme_slug = wp_stream_get_meta($record, 'theme_slug', true);
$plugin_slug = wp_stream_get_meta($record, 'plugin_slug', true);
$theme_exists = !empty($theme_slug) && file_exists($file_path);
$plugin_exists = !empty($plugin_slug) && file_exists($file_path);
if ($theme_exists) {
$links[__('Edit File', 'stream')] = add_query_arg(array('theme' => urlencode($theme_slug), 'file' => urlencode($file_name)), self_admin_url('theme-editor.php'));
$links[__('Theme Details', 'stream')] = add_query_arg(array('theme' => urlencode($theme_slug)), self_admin_url('themes.php'));
}
if ($plugin_exists) {
$links[__('Edit File', 'stream')] = add_query_arg(array('plugin' => urlencode($plugin_slug), 'file' => urlencode(str_ireplace(trailingslashit(WP_PLUGIN_DIR), '', $file_path))), self_admin_url('plugin-editor.php'));
}
}
}
return $links;
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:class-wp-stream-connector-editor.php
示例10: column_default
function column_default($item, $column_name)
{
switch ($column_name) {
case 'date':
$date_string = sprintf('<time datetime="%s" class="relative-time">%s</time>', $item->created, get_date_from_gmt($item->created, 'Y/m/d'));
$out = $this->column_link($date_string, 'date', date('Y/m/d', strtotime($item->created)));
$out .= '<br />';
$out .= get_date_from_gmt($item->created, 'h:i:s A');
break;
case 'summary':
$out = $item->summary;
if ($item->object_id) {
$out .= $this->column_link('<span class="dashicons dashicons-search stream-filter-object-id"></span>', array('object_id' => $item->object_id, 'context' => $item->context), null, __('View all records for this object', 'stream'));
}
$out .= $this->get_action_links($item);
break;
case 'author':
require_once WP_STREAM_INC_DIR . 'class-wp-stream-author.php';
$author_meta = wp_stream_get_meta($item->ID, 'author_meta', true);
$author = new WP_Stream_Author((int) $item->author, $author_meta);
$out = sprintf('<a href="%s">%s <span>%s</span></a>%s%s%s', $author->get_records_page_url(), $author->get_avatar_img(80), $author->get_display_name(), $author->is_deleted() ? sprintf('<br /><small class="deleted">%s</small>', esc_html__('Deleted User', 'stream')) : '', $author->get_role() ? sprintf('<br /><small>%s</small>', $author->get_role()) : '', $author->get_agent() ? sprintf('<br /><small>%s</small>', WP_Stream_Author::get_agent_label($author->get_agent())) : '');
break;
case 'connector':
case 'context':
case 'action':
$out = $this->column_link($this->get_term_title($item->{$column_name}, $column_name), $column_name, $item->{$column_name});
break;
case 'ip':
$out = $this->column_link($item->{$column_name}, 'ip', $item->{$column_name});
break;
case 'id':
$out = absint($item->ID);
break;
case 'blog_id':
$blog = $item->blog_id && is_multisite() ? get_blog_details($item->blog_id) : WP_Stream_Network::get_network_blog();
$out = sprintf('<a href="%s"><span>%s</span></a>', add_query_arg(array('blog_id' => $blog->blog_id), network_admin_url('admin.php?page=wp_stream')), esc_html($blog->blogname));
break;
default:
/**
* Registers new Columns to be inserted into the table. The cell contents of this column is set
* below with 'wp_stream_inster_column_default-'
*
* @param array $new_columns Array of new column titles to add
*/
$inserted_columns = apply_filters('wp_stream_register_column_defaults', $new_columns = array());
if (!empty($inserted_columns) && is_array($inserted_columns)) {
foreach ($inserted_columns as $column_title) {
/**
* If column title inserted via wp_stream_register_column_defaults ($column_title) exists
* among columns registered with get_columns ($column_name) and there is an action associated
* with this column, do the action
*
* Also, note that the action name must include the $column_title registered
* with wp_stream_register_column_defaults
*/
if ($column_title == $column_name && has_action('wp_stream_insert_column_default-' . $column_title)) {
/**
* This action allows for the addition of content under the specified column ($column_title)
*
* @param string $column_title Title of the column (set in wp_stream_register_column_defaults)
* @param obj $item Contents of the row
*/
$out = do_action('wp_stream_insert_column_default-' . $column_title, $item);
} else {
$out = $column_name;
}
}
} else {
$out = $column_name;
// xss ok
}
}
echo $out;
// xss ok
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:75,代码来源:list-table.php
示例11: get_stream_meta
/**
* get_stream_meta()
*
* @deprecated 1.3.2
* @deprecated Use wp_stream_get_meta
* @see wp_stream_get_meta()
*/
function get_stream_meta($record_id, $key = '', $single = false)
{
_deprecated_function(__FUNCTION__, '1.3.2', 'wp_stream_get_meta()');
return wp_stream_get_meta($record_id, $key, $single);
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:12,代码来源:deprecated.php
示例12: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if (in_array($record->context, array('downloads'))) {
$links = WP_Stream_Connector_Posts::action_links($links, $record);
} elseif (in_array($record->context, array('discounts'))) {
$post_type_label = get_post_type_labels(get_post_type_object('edd_discount'))->singular_name;
$base = admin_url('edit.php?post_type=download&page=edd-discounts');
$links[sprintf(__('Edit %s', 'stream'), $post_type_label)] = add_query_arg(array('edd-action' => 'edit_discount', 'discount' => $record->object_id), $base);
if ('active' === get_post($record->object_id)->post_status) {
$links[sprintf(__('Deactivate %s', 'stream'), $post_type_label)] = add_query_arg(array('edd-action' => 'deactivate_discount', 'discount' => $record->object_id), $base);
} else {
$links[sprintf(__('Activate %s', 'stream'), $post_type_label)] = add_query_arg(array('edd-action' => 'activate_discount', 'discount' => $record->object_id), $base);
}
} elseif (in_array($record->context, array('download_category', 'download_tag'))) {
$tax_label = get_taxonomy_labels(get_taxonomy($record->context))->singular_name;
$links[sprintf(__('Edit %s', 'stream'), $tax_label)] = get_edit_term_link($record->object_id, wp_stream_get_meta($record, 'taxonomy', true));
} elseif ('api_keys' === $record->context) {
$user = new WP_User($record->object_id);
if (apply_filters('edd_api_log_requests', true)) {
$links[__('View API Log', 'stream')] = add_query_arg(array('view' => 'api_requests', 'post_type' => 'download', 'page' => 'edd-reports', 'tab' => 'logs', 's' => $user->user_email), 'edit.php');
}
$links[__('Revoke', 'stream')] = add_query_arg(array('post_type' => 'download', 'user_id' => $record->object_id, 'edd_action' => 'process_api_key', 'edd_api_process' => 'revoke'), 'edit.php');
$links[__('Reissue', 'stream')] = add_query_arg(array('post_type' => 'download', 'user_id' => $record->object_id, 'edd_action' => 'process_api_key', 'edd_api_process' => 'regenerate'), 'edit.php');
}
return $links;
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:36,代码来源:class-wp-stream-connector-edd.php
示例13: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
$context_labels = self::get_context_labels();
$rules = array('stream' => array('menu_slug' => 'wp_stream', 'submenu_slug' => WP_Stream_Admin::SETTINGS_PAGE_SLUG, 'url' => function ($rule, $record) {
$option_key = wp_stream_get_meta($record, 'option_key', true);
$url_tab = null;
if ('' !== $option_key) {
foreach (WP_Stream_Settings::get_fields() as $tab_name => $tab_properties) {
foreach ($tab_properties['fields'] as $field) {
$field_key = sprintf('%s_%s', $tab_name, $field['name']);
if ($field_key === $option_key) {
$url_tab = $tab_name;
break 2;
}
}
}
}
return add_query_arg(array('page' => $rule['submenu_slug'], 'tab' => $url_tab), admin_url('admin.php'));
}, 'applicable' => function ($submenu, $record) {
return $record->context === 'wp_stream';
}), 'background_header' => array('menu_slug' => 'themes.php', 'submenu_slug' => function ($record) {
return str_replace('_', '-', $record->context);
}, 'url' => function ($rule, $record) {
return add_query_arg('page', $rule['submenu_slug']($record), admin_url($rule['menu_slug']));
}, 'applicable' => function ($submenu, $record) {
return in_array($record->context, array('custom_header', 'custom_background'));
}), 'general' => array('menu_slug' => 'options-general.php', 'submenu_slug' => function ($record) {
return sprintf('options-%s.php', $record->context);
}, 'url' => function ($rule, $record) {
return admin_url($rule['submenu_slug']($record));
}, 'applicable' => function ($submenu, $record) {
return !empty($submenu['options-general.php']);
}), 'network' => array('menu_slug' => 'settings.php', 'submenu_slug' => function ($record) {
return 'settings.php';
}, 'url' => function ($rule, $record) {
return network_admin_url($rule['menu_slug']);
}, 'applicable' => function ($submenu, $record) {
if (!$record->blog_id) {
return !empty($submenu['settings.php']);
}
return false;
}));
if ('settings' !== $record->context && in_array($record->context, array_keys($context_labels))) {
global $submenu;
$applicable_rules = array_filter($rules, function ($rule) use($submenu, $record) {
return call_user_func($rule['applicable'], $submenu, $record);
});
if (!empty($applicable_rules)) {
// The first applicable rule wins
$rule = array_shift($applicable_rules);
$menu_slug = $rule['menu_slug'];
$submenu_slug = is_object($rule['submenu_slug']) && $rule['submenu_slug'] instanceof Closure ? $rule['submenu_slug']($record) : $rule['submenu_slug'];
$url = $rule['url']($rule, $record);
if (isset($submenu[$menu_slug])) {
$found_submenus = wp_list_filter($submenu[$menu_slug], array(2 => $submenu_slug));
}
if (!empty($found_submenus)) {
$target_submenu = array_pop($found_submenus);
list($menu_title, $capability) = $target_submenu;
if (current_user_can($capability)) {
$url = apply_filters('wp_stream_action_link_url', $url, $record);
$text = sprintf(__('Edit %s Settings', 'stream'), $context_labels[$record->context]);
$field_name = wp_stream_get_meta($record, 'option_key', true);
if ('' === $field_name) {
$field_name = wp_stream_get_meta($record, 'option', true);
}
if ('' !== $field_name) {
$url = sprintf('%s#%s%s', rtrim(preg_replace('/#.*/', '', $url), '/'), self::HIGHLIGHT_FIELD_URL_HASH_PREFIX, $field_name);
}
$links[$text] = $url;
}
}
}
}
return $links;
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:86,代码来源:class-wp-stream-connector-settings.php
示例14: widget_row
/**
* Renders rows for Stream Activity Dashboard Widget
*
* @param obj Record to be inserted
* @param int Row number
* @return string Contents of new row
*/
public static function widget_row($item, $i = null)
{
require_once WP_STREAM_INC_DIR . 'class-wp-stream-author.php';
$author_meta = wp_stream_get_meta($item->ID, 'author_meta', true);
$author = new WP_Stream_Author((int) $item->author, $author_meta);
$time_author = sprintf(_x('%1$s ago by <a href="%2$s">%3$s</a>', '1: Time, 2: User profile URL, 3: User display name', 'stream'), human_time_diff(strtotime($item->created)), esc_url($author->get_records_page_url()), esc_html($author->get_display_name()));
if ($author->get_agent()) {
$time_author .= sprintf(' %s', WP_Stream_Author::get_agent_label($author->get_agent()));
}
$class = isset($i) && $i % 2 ? 'alternate' : '';
ob_start();
?>
<li class="<?php
echo esc_html($class);
?>
" data-id="<?php
echo esc_html($item->ID);
?>
">
<div class="record-avatar">
<a href="<?php
echo esc_url($author->get_records_page_url());
?>
">
<?php
echo $author->get_avatar_img(72);
// xss ok
?>
</a>
</div>
<span class="record-meta"><?php
echo $time_author;
// xss ok
?>
</span>
<br />
<?php
echo esc_html($item->summary);
?>
</li><?php
return ob_get_clean();
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:49,代码来源:dashboard.php
示例15: wp_stream_update_migrate_media_to_attachment_type
function wp_stream_update_migrate_media_to_attachment_type()
{
global $wpdb;
$sql = "SELECT r.ID id, r.object_id pid, c.meta_id mid\n\t\tFROM {$wpdb->stream} r\n\t\tJOIN {$wpdb->streamcontext} c\n\t\t\tON r.ID = c.record_id AND c.connector = 'media' AND c.context = 'media'\n\t";
$records = $wpdb->get_results($sql);
// db call ok
foreach ($records as $record) {
$post = get_post($record->pid);
$guid = isset($post->guid) ? $post->guid : null;
$url = $guid ? $guid : wp_stream_get_meta($record->id, 'url', true);
if (!empty($url)) {
$wpdb->update($wpdb->streamcontext, array('context' => WP_Stream_Connector_Media::get_attachment_type($url)), array('record_id' => $record->id), array('%s'), array('%d'));
}
}
}
开发者ID:xwp,项目名称:stream-legacy,代码行数:15,代码来源:db-updates.php
示例16: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if (in_array($record->context, self::$post_types) && get_post($record->object_id)) {
if ($link = get_edit_post_link($record->object_id)) {
$post_type_name = WP_Stream_Connector_Posts::get_post_type_name(get_post_type($record->object_id));
$links[sprintf(_x('Edit %s', 'Post type singular name', 'stream'), $post_type_name)] = $link;
}
if (post_type_exists(get_post_type($record->object_id)) && ($link = get_permalink($record->object_id))) {
$links[__('View', 'stream')] = $link;
}
}
$context_labels = self::get_context_labels();
$option_key = wp_stream_get_meta($record, 'option', true);
$option_page = wp_stream_get_meta($record, 'page', true);
$option_tab = wp_stream_get_meta($record, 'tab', true);
$option_section = wp_stream_get_meta($record, 'section', true);
if ($option_key && $option_tab) {
$text = sprintf(__('Edit WooCommerce %s', 'stream'), $context_labels[$record->context]);
$url = add_query_arg(array('page' => $option_page, 'tab' => $option_tab, 'section' => $option_section), admin_url('admin.php'));
$links[$text] = $url . '#wp-stream-highlight:' . $option_key;
}
return $links;
}
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:33,代码来源:class-wp-stream-connector-woocommerce.php
示例17: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if (in_array($record->context, array('components'))) {
$option_key = wp_stream_get_meta($record, 'option_key', true);
if ('bp-active-components' === $option_key) {
$links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-components'), admin_url('admin.php'));
} elseif ('bp-pages' === $option_key) {
$page_id = wp_stream_get_meta($record, 'page_id', true);
$links[__('Edit setting', 'stream')] = add_query_arg(array('page' => 'bp-page-settings'), admin_url('admin.php'));
if ($page_id) {
$links[__('Edit Page', 'stream')] = get_edit_post_link($page_id);
$links[__('View', 'stream')] = get_permalink($page_id);
}
}
} elseif (in_array($record->context, array('settings'))) {
$links[__('Edit setting', 'stream')] = add_query_arg(array('page' => wp_stream_get_meta($record, 'page', true)), admin_url('admin.php'));
} elseif (in_array($record->context, array('groups'))) {
$group_id = wp_stream_get_meta($record, 'id', true);
$group = groups_get_group(array('group_id' => $group_id));
if ($group) {
// Build actions URLs
$base_url = bp_get_admin_url('admin.php?page=bp-groups&gid=' . $group_id);
$delete_url = wp_nonce_url($base_url . '&action=delete', 'bp-groups-delete');
$edit_url = $base_url . '&action=edit';
$visit_url = bp_get_group_permalink($group);
$links[__('Edit group', 'stream')] = $edit_url;
$links[__('View group', 'stream')] = $visit_url;
$links[__('Delete group', 'stream')] = $delete_url;
}
} elseif (in_array($record->context, array('activity'))) {
$activity_id = wp_stream_get_meta($record, 'id', true);
$activities = bp_activity_get(array('in' => $activity_id, 'spam' => 'all'));
if (!empty($activities['activities'])) {
$activity = reset($activities['activities']);
$base_url = bp_get_admin_url('admin.php?page=bp-activity&aid=' . $activity->id);
$spam_nonce = esc_html('_wpnonce=' . wp_create_nonce('spam-activity_' . $activity->id));
$delete_url = $base_url . "&action=delete&{$spam_nonce}";
$edit_url = $base_url . '&action=edit';
$ham_url = $base_url . "&action=ham&{$spam_nonce}";
$spam_url = $base_url . "&action=spam&{$spam_nonce}";
if ($activity->is_spam) {
$links[__('Ham', 'stream')] = $ham_url;
} else {
$links[__('Edit', 'stream')] = $edit_url;
$links[__('Spam', 'stream')] = $spam_url;
}
$links[__('Delete', 'stream')] = $delete_url;
}
} elseif (in_array($record->context, array('profile_fields'))) {
$field_id = wp_stream_get_meta($record, 'field_id', true);
$group_id = wp_stream_get_meta($record, 'group_id', true);
if (empty($field_id)) {
// is a group action
$links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $group_id), admin_url('users.php'));
$links[__('Delete', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'delete_group', 'group_id' => $group_id), admin_url('users.php'));
} else {
$field = new BP_XProfile_Field($field_id);
if (empty($field->type)) {
return $links;
}
$links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'edit_field', 'group_id' => $group_id, 'field_id' => $field_id), admin_url('users.php'));
$links[__('Delete', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'delete_field', 'field_id' => $field_id), admin_url('users.php'));
}
}
return $links;
}
开发者ID:johnleesw,项目名称:mustardseedwp,代码行数:76,代码来源:class-wp-stream-connector-buddypress.php
示例18: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if ('forms' === $record->context) {
$links[__('Edit', 'gravityforms')] = add_query_arg(array('page' => 'gf_edit_forms', 'id' => $record->object_id), admin_url('admin.php'));
} elseif ('entries' === $record->context) {
$links[__('View', 'gravityforms')] = add_query_arg(array('page' => 'gf_entries', 'view' => 'entry', 'lid' => $record->object_id, 'id' => wp_stream_get_meta($record, 'form_id', true)), admin_url('admin.php'));
} elseif ('notes' === $record->context) {
$links[__('View', 'gravityforms')] = add_query_arg(array('page' => 'gf_entries', 'view' => 'entry', 'lid' => wp_stream_get_meta($record, 'lead_id', true), 'id' => wp_stream_get_meta($record, 'form_id', true)), admin_url('admin.php'));
} elseif ('settings' === $record->context) {
$links[__('Edit Settings', 'stream')] = add_query_arg(array('page' => 'gf_settings'), admin_url('admin.php'));
}
return $links;
}
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:23,代码来源:class-wp-stream-connector-gravityforms.php
示例19: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public static function action_links($links, $record)
{
if ('settings' === $record->context) {
$option = wp_stream_get_meta($record, 'option', true);
$links[__('Edit', 'stream')] = esc_url(add_query_arg(array('page' => 'bbpress'), admin_url('options-general.php')) . esc_url_raw('#' . $option));
}
return $links;
}
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:18,代码来源:class-wp-stream-connector-bbpress.php
-
In openFile of CallLogProvider.java, there is a possible permission bypass due t
阅读:939|2022-07-29
-
IonicChina/ioniclub: The mobile app of http://ionichina.com/
阅读:844|2022-08-30
-
joaomh/curso-de-matlab
阅读:1149|2022-08-17
-
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1081|2022-08-17
-
1.实验目的 (1)掌握MATLAB基本语法 (2)掌握使用MATLAB进行图像、音频文件的基本
阅读:1397|2022-07-18
-
Cross-site scripting vulnerability in LiteCart versions prior to 2.4.2 allows a
阅读:590|2022-07-29
-
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:762|2022-08-16
-
kbranigan/Simple-OpenGL-Image-Library: Simple image uploader primarily for OpenG
阅读:988|2022-08-15
-
efri-yang/mobileValidate: 移动端表单验证控件(适用于jquery和zepto)
阅读:423|2022-08-30
-
“一问三不知”是怎么来的呢?为什么没说一问四不知呢?这“三不知”指的是哪三件不知道
阅读:226|2022-11-06
|
请发表评论