Initial commit
This commit is contained in:
commit
28e6ddf404
1083 changed files with 191734 additions and 0 deletions
48
plugins/jetpack/modules/omnisearch/omnisearch-comments.php
Normal file
48
plugins/jetpack/modules/omnisearch/omnisearch-comments.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
if( ! class_exists( 'WP_Comments_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php' );
|
||||
|
||||
class Jetpack_Omnisearch_Comments extends WP_Comments_List_Table {
|
||||
static $instance;
|
||||
public $checkbox = false;
|
||||
|
||||
function __construct() {
|
||||
self::$instance = $this;
|
||||
add_filter( 'omnisearch_results', array( $this, 'search'), 10, 2 );
|
||||
}
|
||||
|
||||
function search( $results, $search_term ) {
|
||||
$search_url = esc_url( admin_url( sprintf( 'edit-comments.php?s=%s', urlencode( $search_term ) ) ) );
|
||||
$search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__('Search Comments', 'jetpack') );
|
||||
$html = '<h2>' . esc_html__('Comments', 'jetpack') . $search_link . '</h2>';
|
||||
parent::__construct();
|
||||
|
||||
ob_start();
|
||||
$this->prepare_items();
|
||||
$this->_column_headers = array( $this->get_columns(), array(), array() );
|
||||
$this->display();
|
||||
$html .= ob_get_clean();
|
||||
|
||||
$label = __( 'Comments', 'jetpack' );
|
||||
$results[ $label ] = $html;
|
||||
return $results;
|
||||
}
|
||||
|
||||
function get_per_page( $comment_status = 'all' ) {
|
||||
/** This action is documented in modules/omnisearch/omnisearch-core.php */
|
||||
return apply_filters( 'omnisearch_num_results', 5 );
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function pagination( $which ) {}
|
||||
|
||||
function extra_tablenav( $which ) {}
|
||||
}
|
235
plugins/jetpack/modules/omnisearch/omnisearch-core.php
Normal file
235
plugins/jetpack/modules/omnisearch/omnisearch-core.php
Normal file
|
@ -0,0 +1,235 @@
|
|||
<?php
|
||||
|
||||
// Include this here so that other plugins can extend it if they like.
|
||||
require_once( dirname(__FILE__) . '/omnisearch-posts.php' );
|
||||
|
||||
class Jetpack_Omnisearch {
|
||||
static $instance;
|
||||
static $num_results = 5;
|
||||
|
||||
function __construct() {
|
||||
self::$instance = $this;
|
||||
add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
|
||||
add_action( 'admin_init', array( $this, 'add_providers' ) );
|
||||
add_action( 'jetpack_admin_menu', array( $this, 'jetpack_admin_menu' ) );
|
||||
add_action( 'admin_menu', array( $this, 'admin_menu' ), 20 );
|
||||
if( ! jetpack_is_mobile() ) {
|
||||
add_action( 'admin_bar_menu', array( $this, 'admin_bar_search' ), 4 );
|
||||
}
|
||||
add_filter( 'omnisearch_num_results', array( $this, 'omnisearch_num_results' ) );
|
||||
}
|
||||
|
||||
static function add_providers() {
|
||||
// omnisearch-posts.php is included above, so that other plugins can more easily extend it.
|
||||
new Jetpack_Omnisearch_Posts;
|
||||
new Jetpack_Omnisearch_Posts( 'page' );
|
||||
|
||||
require_once( dirname(__FILE__) . '/omnisearch-comments.php' );
|
||||
new Jetpack_Omnisearch_Comments;
|
||||
|
||||
if ( current_user_can( 'upload_files' ) ) {
|
||||
require_once( dirname(__FILE__) . '/omnisearch-media.php' );
|
||||
new Jetpack_Omnisearch_Media;
|
||||
}
|
||||
|
||||
if ( current_user_can( 'install_plugins' ) ) {
|
||||
require_once( dirname(__FILE__) . '/omnisearch-plugins.php' );
|
||||
new Jetpack_Omnisearch_Plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after each default omnisearch provider has been required.
|
||||
*
|
||||
* Can be used to add your own Omnisearch provider.
|
||||
*
|
||||
* @module omnisearch
|
||||
*
|
||||
* @since 2.3.2
|
||||
*/
|
||||
do_action( 'omnisearch_add_providers' );
|
||||
}
|
||||
|
||||
static function omnisearch_num_results( $num ) {
|
||||
return self::$num_results;
|
||||
}
|
||||
|
||||
function wp_loaded() {
|
||||
$deps = null;
|
||||
if ( wp_style_is( 'genericons', 'registered' ) ) {
|
||||
$deps = array( 'genericons' );
|
||||
}
|
||||
if( is_rtl() ) {
|
||||
wp_register_style( 'omnisearch-admin', plugins_url( 'rtl/omnisearch-rtl.css', __FILE__ ), $deps );
|
||||
} else {
|
||||
wp_register_style( 'omnisearch-admin', plugins_url( 'omnisearch.css', __FILE__ ), $deps );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function jetpack_admin_menu() {
|
||||
remove_submenu_page( 'index.php', 'omnisearch' );
|
||||
$this->slug = add_submenu_page( 'jetpack', __( 'Omnisearch', 'jetpack' ), __( 'Omnisearch', 'jetpack' ), 'edit_posts', 'omnisearch', array( $this, 'omnisearch_page' ) );
|
||||
add_action( "admin_print_styles-{$this->slug}", array( $this, 'admin_print_styles_jetpack' ) );
|
||||
}
|
||||
|
||||
function admin_menu() {
|
||||
$this->slug = add_dashboard_page( __( 'Omnisearch', 'jetpack' ), __( 'Omnisearch', 'jetpack' ), 'edit_posts', 'omnisearch', array( $this, 'omnisearch_page' ) );
|
||||
add_action( "admin_print_styles-{$this->slug}", array( $this, 'admin_print_styles' ) );
|
||||
}
|
||||
|
||||
function admin_print_styles() {
|
||||
wp_enqueue_style( 'omnisearch-admin' );
|
||||
}
|
||||
|
||||
function admin_print_styles_jetpack() {
|
||||
wp_enqueue_style( 'omnisearch-admin' );
|
||||
wp_enqueue_style( 'omnisearch-jetpack' );
|
||||
}
|
||||
|
||||
function omnisearch_page() {
|
||||
$results = array();
|
||||
$s = isset( $_GET['s'] ) ? $_GET['s'] : '';
|
||||
if ( $s ) {
|
||||
/**
|
||||
* Filter the results returned for a given Omnisearch search query.
|
||||
*
|
||||
* @module omnisearch
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param array $results Array of Omnisearch results.
|
||||
* @param string $s Search parameter.
|
||||
*/
|
||||
$results = apply_filters( 'omnisearch_results', $results, $s );
|
||||
}
|
||||
/**
|
||||
* Filter the number of results displayed for each Omnisearch searched section.
|
||||
*
|
||||
* @module omnisearch
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param int 5 Number of results displayed for each Omnisearch searched section.
|
||||
*/
|
||||
$num_results = intval( apply_filters( 'omnisearch_num_results', 5 ) );
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2 class="page-title"><?php esc_html_e( 'Omnisearch', 'jetpack' ); ?> <small><?php esc_html_e( 'search everything', 'jetpack' ); ?></small></h2>
|
||||
<br class="clear" />
|
||||
<?php echo self::get_omnisearch_form( array(
|
||||
'form_class' => 'omnisearch-form',
|
||||
'search_class' => 'omnisearch',
|
||||
'search_placeholder' => '',
|
||||
'submit_class' => 'omnisearch-submit',
|
||||
'alternate_submit' => true,
|
||||
) ); ?>
|
||||
<?php if( ! empty( $results ) ): ?>
|
||||
<h3 id="results-title"><?php esc_html_e( 'Results:', 'jetpack' ); ?></h3>
|
||||
<div class="jump-to"><strong><?php esc_html_e( 'Jump to:', 'jetpack' ); ?></strong>
|
||||
<?php foreach( $results as $label => $result ) : ?>
|
||||
<a href="#result-<?php echo sanitize_title( $label ); ?>"><?php echo esc_html( $label ); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<script>var search_term = '<?php echo esc_js( $s ); ?>', num_results = <?php echo $num_results; ?>;</script>
|
||||
<ul class="omnisearch-results">
|
||||
<?php foreach( $results as $label => $result ) : ?>
|
||||
<li id="result-<?php echo sanitize_title( $label ); ?>" data-label="<?php echo esc_attr( $label ); ?>">
|
||||
<?php echo $result; ?>
|
||||
<a class="back-to-top" href="#results-title"><?php esc_html_e( 'Back to Top ↑', 'jetpack' ); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div><!-- /wrap -->
|
||||
<?php
|
||||
}
|
||||
|
||||
function admin_bar_search( $wp_admin_bar ) {
|
||||
if(
|
||||
! is_admin() ||
|
||||
! current_user_can( 'edit_posts' ) ||
|
||||
(
|
||||
function_exists( 'wpcom_use_wpadmin_flows' ) &&
|
||||
! wpcom_use_wpadmin_flows()
|
||||
)
|
||||
)
|
||||
return;
|
||||
|
||||
$form = self::get_omnisearch_form( array(
|
||||
'form_id' => 'adminbarsearch',
|
||||
'search_id' => 'adminbar-search',
|
||||
'search_class' => 'adminbar-input',
|
||||
'submit_class' => 'adminbar-button',
|
||||
) );
|
||||
|
||||
$form .= "<style>
|
||||
#adminbar-search::-webkit-input-placeholder,
|
||||
#adminbar-search:-moz-placeholder,
|
||||
#adminbar-search::-moz-placeholder,
|
||||
#adminbar-search:-ms-input-placeholder {
|
||||
text-shadow: none;
|
||||
}
|
||||
</style>";
|
||||
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'parent' => 'top-secondary',
|
||||
'id' => 'search',
|
||||
'title' => $form,
|
||||
'meta' => array(
|
||||
'class' => 'admin-bar-search',
|
||||
'tabindex' => -1,
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
static function get_omnisearch_form( $args = array() ) {
|
||||
$defaults = array(
|
||||
'form_id' => null,
|
||||
'form_class' => null,
|
||||
'search_class' => null,
|
||||
'search_id' => null,
|
||||
'search_value' => isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : null,
|
||||
'search_placeholder' => __( 'Search Everything', 'jetpack' ),
|
||||
'submit_class' => 'button',
|
||||
'submit_value' => __( 'Search', 'jetpack' ),
|
||||
'alternate_submit' => false,
|
||||
);
|
||||
extract( array_map( 'esc_attr', wp_parse_args( $args, $defaults ) ) );
|
||||
|
||||
$rand = rand();
|
||||
if( empty( $form_id ) )
|
||||
$form_id = "omnisearch_form_$rand";
|
||||
if( empty( $search_id ) )
|
||||
$search_id = "omnisearch_search_$rand";
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<form action="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>" method="get" class="<?php echo $form_class; ?>" id="<?php echo $form_id; ?>">
|
||||
<input type="hidden" name="page" value="omnisearch" />
|
||||
<input name="s" type="search" class="<?php echo $search_class; ?>" id="<?php echo $search_id; ?>" value="<?php echo $search_value; ?>" placeholder="<?php echo $search_placeholder; ?>" />
|
||||
<?php if ( $alternate_submit ) : ?>
|
||||
<button type="submit" class="<?php echo $submit_class; ?>"><span><?php echo $submit_value; ?></span></button>
|
||||
<?php else : ?>
|
||||
<input type="submit" class="<?php echo $submit_class; ?>" value="<?php echo $submit_value; ?>" />
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Filters the Omnisearch search form output.
|
||||
*
|
||||
* @module omnisearch
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param string ob_get_clean() Omnisearch search form output.
|
||||
* @param array $args Array of arguments to pass to the form to overwrite the default form parameters.
|
||||
* @param array $defaults Array of default form parameters.
|
||||
*/
|
||||
return apply_filters( 'get_omnisearch_form', ob_get_clean(), $args, $defaults );
|
||||
}
|
||||
|
||||
}
|
||||
new Jetpack_Omnisearch;
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
ul#adminmenu a.wp-has-current-submenu:after,
|
||||
ul#adminmenu > li.current > a.current:after {
|
||||
border-left-color:#8da94c;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child > h2 {
|
||||
text-shadow: none;
|
||||
}
|
1
plugins/jetpack/modules/omnisearch/omnisearch-jetpack-rtl.min.css
vendored
Normal file
1
plugins/jetpack/modules/omnisearch/omnisearch-jetpack-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-left-color:#8da94c;display:none}.omnisearch-results>li:first-child>h2{text-shadow:none}
|
10
plugins/jetpack/modules/omnisearch/omnisearch-jetpack.css
Normal file
10
plugins/jetpack/modules/omnisearch/omnisearch-jetpack.css
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
ul#adminmenu a.wp-has-current-submenu:after,
|
||||
ul#adminmenu > li.current > a.current:after {
|
||||
border-right-color:#8da94c;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child > h2 {
|
||||
text-shadow: none;
|
||||
}
|
1
plugins/jetpack/modules/omnisearch/omnisearch-jetpack.min.css
vendored
Normal file
1
plugins/jetpack/modules/omnisearch/omnisearch-jetpack.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after{border-right-color:#8da94c;display:none}.omnisearch-results>li:first-child>h2{text-shadow:none}
|
44
plugins/jetpack/modules/omnisearch/omnisearch-media.php
Normal file
44
plugins/jetpack/modules/omnisearch/omnisearch-media.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
if( ! class_exists( 'WP_Media_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
|
||||
|
||||
class Jetpack_Omnisearch_Media extends WP_Media_List_Table {
|
||||
static $instance;
|
||||
|
||||
function __construct() {
|
||||
self::$instance = $this;
|
||||
add_filter( 'omnisearch_results', array( $this, 'search' ), 10, 2 );
|
||||
}
|
||||
|
||||
function search( $results, $search_term ) {
|
||||
$search_url = esc_url( add_query_arg( 's', $search_term, admin_url( 'upload.php' ) ) );
|
||||
$search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__( 'Search Media', 'jetpack' ) );
|
||||
$html = '<h2>' . esc_html__( 'Media', 'jetpack' ) . $search_link . '</h2>';
|
||||
parent::__construct();
|
||||
|
||||
ob_start();
|
||||
$this->prepare_items();
|
||||
$columns = $this->get_columns();
|
||||
unset( $columns['cb'] );
|
||||
$this->_column_headers = array( $columns, array(), array() );
|
||||
$this->display();
|
||||
$html .= ob_get_clean();
|
||||
|
||||
$label = __( 'Media', 'jetpack' );
|
||||
$results[ $label ] = $html;
|
||||
return $results;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function pagination( $which ) {}
|
||||
|
||||
function extra_tablenav( $which ) {}
|
||||
}
|
61
plugins/jetpack/modules/omnisearch/omnisearch-plugins.php
Normal file
61
plugins/jetpack/modules/omnisearch/omnisearch-plugins.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
if( ! class_exists( 'WP_Plugin_Install_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
|
||||
|
||||
class Jetpack_Omnisearch_Plugins extends WP_Plugin_Install_List_Table {
|
||||
static $instance;
|
||||
|
||||
function __construct() {
|
||||
self::$instance = $this;
|
||||
add_filter( 'omnisearch_results', array( $this, 'search'), 10, 2 );
|
||||
add_action( 'wp_ajax_omnisearch_plugins', array( $this, 'wp_ajax_omnisearch_plugins' ) );
|
||||
}
|
||||
|
||||
function search( $results, $search_term ) {
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
add_thickbox();
|
||||
|
||||
$search_url = esc_url( admin_url( sprintf( 'plugin-install.php?tab=search&s=%s', urlencode( $search_term ) ) ) );
|
||||
$search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__('Search Plugins', 'jetpack') );
|
||||
$html = '<h2>' . esc_html__('Plugins', 'jetpack') . $search_link . '</h2>';
|
||||
|
||||
$html .= '<div id="' . __CLASS__ . '_results">' . esc_html__('Loading …', 'jetpack') . '</div>';
|
||||
$html .= '<script>jQuery("#' . __CLASS__ . '_results").load(ajaxurl,{action:"omnisearch_plugins",search_term:search_term,num_results:num_results});</script>';
|
||||
|
||||
$label = __( 'Plugins', 'jetpack' );
|
||||
$results[ $label ] = $html;
|
||||
return $results;
|
||||
}
|
||||
|
||||
function results_html( $search_term, $num_results = null ) {
|
||||
$_GET['tab'] = 'search';
|
||||
$GLOBALS['hook_suffix'] = 'foo';
|
||||
$_REQUEST['s'] = $search_term;
|
||||
parent::__construct();
|
||||
|
||||
ob_start();
|
||||
$this->prepare_items();
|
||||
/** This action is documented in modules/omnisearch/omnisearch-core.php */
|
||||
$num_results = intval( $num_results ) ? intval( $num_results ) : apply_filters( 'omnisearch_num_results', 5 );
|
||||
$this->items = array_slice( $this->items, 0, $num_results );
|
||||
remove_action( 'install_plugins_table_header', 'install_search_form' );
|
||||
$this->display();
|
||||
$html = ob_get_clean();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function wp_ajax_omnisearch_plugins() {
|
||||
$search_term = $_REQUEST['search_term'];
|
||||
$num_results = isset( $_REQUEST['num_results'] ) ? $_REQUEST['num_results'] : null;
|
||||
echo $this->results_html( $search_term, $num_results );
|
||||
exit;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function pagination( $which ) {}
|
||||
}
|
137
plugins/jetpack/modules/omnisearch/omnisearch-posts.php
Normal file
137
plugins/jetpack/modules/omnisearch/omnisearch-posts.php
Normal file
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
if( ! class_exists( 'WP_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
|
||||
class Jetpack_Omnisearch_Posts extends WP_List_Table {
|
||||
public $post_type = 'post',
|
||||
$post_type_object;
|
||||
|
||||
function __construct( $post_type = 'post' ) {
|
||||
$this->post_type = $post_type;
|
||||
add_filter( 'omnisearch_results', array( $this, 'search'), 10, 2 );
|
||||
|
||||
// Push 'post_type_obj' to accepted fields for WP_List_Table (since WP 4.2)
|
||||
global $wp_version;
|
||||
if ( version_compare( $wp_version, '4.2-z', '>=' ) && $this->compat_fields && is_array( $this->compat_fields ) ) {
|
||||
array_push( $this->compat_fields, 'post_type_obj', 'posts' );
|
||||
}
|
||||
}
|
||||
|
||||
function search( $results, $search_term ) {
|
||||
if( ! post_type_exists( $this->post_type ) )
|
||||
return $results;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->post_type_obj = get_post_type_object( $this->post_type );
|
||||
|
||||
$search_url = esc_url( admin_url( sprintf( 'edit.php?post_type=%s&s=%s', urlencode( $this->post_type_obj->name ), urlencode( $search_term ) ) ) );
|
||||
$search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html( $this->post_type_obj->labels->search_items ) );
|
||||
$html = '<h2>' . esc_html( $this->post_type_obj->labels->name ) . $search_link .'</h2>';
|
||||
|
||||
/** This action is documented in modules/omnisearch/omnisearch-core.php */
|
||||
$num_results = apply_filters( 'omnisearch_num_results', 5 );
|
||||
|
||||
$this->posts = get_posts( array(
|
||||
's' => $search_term,
|
||||
'post_type' => $this->post_type,
|
||||
'posts_per_page' => $num_results,
|
||||
'post_status' => 'any',
|
||||
'suppress_filters' => false,
|
||||
) );
|
||||
|
||||
$this->prepare_items();
|
||||
|
||||
ob_start();
|
||||
$this->display();
|
||||
$html .= ob_get_clean();
|
||||
|
||||
$results[ $this->post_type_obj->labels->name ] = $html;
|
||||
return $results;
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
$columns = array(
|
||||
# 'id' => __('ID', 'jetpack'),
|
||||
'post_title' => __('Title', 'jetpack'),
|
||||
'snippet' => __('Snippet', 'jetpack'),
|
||||
'date' => __('Date', 'jetpack'),
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
$columns = $this->get_columns();
|
||||
$hidden = array();
|
||||
$sortable = array();
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
$this->items = $this->posts;
|
||||
}
|
||||
|
||||
function column_post_title( $post ) {
|
||||
$actions = array();
|
||||
if ( current_user_can( $this->post_type_obj->cap->edit_post, $post ) ) {
|
||||
$post_title = sprintf( '<a href="%s">%s</a>', esc_url( get_edit_post_link( $post->ID ) ), wptexturize( $post->post_title ) );
|
||||
$actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( get_edit_post_link( $post->ID ) ), esc_html( $this->post_type_obj->labels->edit_item ) );
|
||||
} else {
|
||||
$post_title = wptexturize( $post->post_title );
|
||||
}
|
||||
if ( current_user_can( $this->post_type_obj->cap->delete_post, $post ) ) {
|
||||
$actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( get_delete_post_link( $post->ID ) ), esc_html__('Trash', 'jetpack') );
|
||||
}
|
||||
$actions['view'] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post->ID ) ), esc_html( $this->post_type_obj->labels->view_item ) );
|
||||
return $post_title . $this->row_actions( $actions );
|
||||
}
|
||||
|
||||
function column_date( $post ) {
|
||||
$html = '';
|
||||
|
||||
if ( '0000-00-00 00:00:00' == $post->post_date ) {
|
||||
$t_time = $h_time = __('Unpublished', 'jetpack');
|
||||
$time_diff = 0;
|
||||
} else {
|
||||
$t_time = date( __('Y/m/d g:i:s A', 'jetpack'), mysql2date( 'G', $post->post_date ) );
|
||||
$m_time = $post->post_date;
|
||||
$time = get_post_time( 'G', true, $post );
|
||||
|
||||
$time_diff = time() - $time;
|
||||
|
||||
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS )
|
||||
$h_time = sprintf( __('%s ago', 'jetpack'), human_time_diff( $time ) );
|
||||
else
|
||||
$h_time = mysql2date( __('Y/m/d', 'jetpack'), $m_time );
|
||||
}
|
||||
|
||||
$html .= '<abbr title="' . esc_attr( $t_time ) . '">' . esc_html( $h_time ) . '</abbr>';
|
||||
$html .= '<br />';
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
$html .= esc_html__('Published', 'jetpack');
|
||||
} elseif ( 'future' == $post->post_status ) {
|
||||
if ( $time_diff > 0 )
|
||||
$html .= '<strong class="attention">' . esc_html__('Missed schedule', 'jetpack') . '</strong>';
|
||||
else
|
||||
$html .= esc_html__('Scheduled', 'jetpack');
|
||||
} else {
|
||||
$html .= esc_html__('Last Modified', 'jetpack');
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function column_default( $post, $column_name ) {
|
||||
switch ( $column_name ) {
|
||||
case 'id':
|
||||
return $post->ID;
|
||||
case 'post_title': // Will never happen, class method overrides.
|
||||
return $post->post_title;
|
||||
case 'snippet':
|
||||
return wp_trim_words( $post->post_content, 55 );
|
||||
case 'date': // Will never happen, class method overrides.
|
||||
$d = get_option('date_format');
|
||||
$t = get_option('time_format');
|
||||
return get_post_modified_time( $d, 0, $post, 1 ) . ' @ ' . get_post_modified_time( $t, 0, $post, 1 );
|
||||
default:
|
||||
return print_r( $post, true );
|
||||
}
|
||||
}
|
||||
}
|
130
plugins/jetpack/modules/omnisearch/omnisearch-rtl.css
Normal file
130
plugins/jetpack/modules/omnisearch/omnisearch-rtl.css
Normal file
|
@ -0,0 +1,130 @@
|
|||
|
||||
h2.page-title small {
|
||||
font-size: 0.6em;
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
opacity: 0.6;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
form.omnisearch-form {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input.omnisearch {
|
||||
border-radius: 0.25em;
|
||||
font-size: 2.2em;
|
||||
line-height: 1.35;
|
||||
padding: 0.25em 0.5em 0.25em 2em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input.omnisearch::-webkit-search-cancel-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.omnisearch-submit {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 2.45em;
|
||||
padding: 0.3em 0.5em 0.1em;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
button.omnisearch-submit::before {
|
||||
font-family: 'Genericons', Noticons;
|
||||
content: '\f400';
|
||||
}
|
||||
|
||||
button.omnisearch-submit span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.5;
|
||||
float: right;
|
||||
margin-top: 0;
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.jump-to {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.jump-to strong,
|
||||
.jump-to a {
|
||||
color: inherit;
|
||||
margin-right: 0.5em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.jump-to a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
display: block;
|
||||
float: left;
|
||||
margin-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results {
|
||||
|
||||
}
|
||||
|
||||
.omnisearch-results > li {
|
||||
padding-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .add-new-h2 {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wp-list-table .column-snippet {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.wp-list-table .column-date {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.comments .column-author {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.wp-list-table.media th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-parent {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-comments span.vers {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tablenav {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .tablenav.top {
|
||||
margin: 5px 0;
|
||||
}
|
1
plugins/jetpack/modules/omnisearch/omnisearch-rtl.min.css
vendored
Normal file
1
plugins/jetpack/modules/omnisearch/omnisearch-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
h2.page-title small{font-size:.6em;font-weight:300;font-style:italic;opacity:.6;margin-right:.5em}form.omnisearch-form{position:relative}input.omnisearch{border-radius:.25em;font-size:2.2em;line-height:1.35;padding:.25em .5em .25em 2em;width:100%}input.omnisearch::-webkit-search-cancel-button{display:none}button.omnisearch-submit{background:0 0;border:0;cursor:pointer;display:block;font-size:2.45em;padding:.3em .5em .1em;text-align:center;position:absolute;left:0;bottom:0}button.omnisearch-submit::before{font-family:Genericons,Noticons;content:'\f400'}button.omnisearch-submit span{display:none}#results-title,.jump-to{font-size:1.2em;line-height:1.5;float:right;margin-top:0;padding-top:2em}#results-title,.jump-to strong{font-weight:600}.jump-to{float:left;text-align:left}.jump-to a,.jump-to strong{color:inherit;margin-right:.5em;text-decoration:none}.jump-to a:hover{text-decoration:underline}.back-to-top{display:block;float:left;margin-top:2.5em}.omnisearch-results>li{padding-top:2.5em}.omnisearch-results>li:first-child{padding-top:0}.omnisearch-results .add-new-h2{display:inline}.wp-list-table .column-snippet{width:65%}.wp-list-table .column-date{width:15%}.wp-list-table.comments .column-author{width:20%}.wp-list-table.media th{white-space:nowrap}.wp-list-table.media .column-parent{width:15%}.wp-list-table.media .column-comments span.vers{display:block}.tablenav{height:0}.omnisearch-results .tablenav.top{margin:5px 0}
|
130
plugins/jetpack/modules/omnisearch/omnisearch.css
Normal file
130
plugins/jetpack/modules/omnisearch/omnisearch.css
Normal file
|
@ -0,0 +1,130 @@
|
|||
|
||||
h2.page-title small {
|
||||
font-size: 0.6em;
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
opacity: 0.6;
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
form.omnisearch-form {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input.omnisearch {
|
||||
border-radius: 0.25em;
|
||||
font-size: 2.2em;
|
||||
line-height: 1.35;
|
||||
padding: 0.25em 2em 0.25em 0.5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input.omnisearch::-webkit-search-cancel-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.omnisearch-submit {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 2.45em;
|
||||
padding: 0.3em 0.5em 0.1em;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
button.omnisearch-submit::before {
|
||||
font-family: 'Genericons', Noticons;
|
||||
content: '\f400';
|
||||
}
|
||||
|
||||
button.omnisearch-submit span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.5;
|
||||
float: left;
|
||||
margin-top: 0;
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.jump-to {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.jump-to strong,
|
||||
.jump-to a {
|
||||
color: inherit;
|
||||
margin-left: 0.5em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.jump-to a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
display: block;
|
||||
float: right;
|
||||
margin-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results {
|
||||
|
||||
}
|
||||
|
||||
.omnisearch-results > li {
|
||||
padding-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .add-new-h2 {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wp-list-table .column-snippet {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.wp-list-table .column-date {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.comments .column-author {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.wp-list-table.media th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-parent {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-comments span.vers {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tablenav {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .tablenav.top {
|
||||
margin: 5px 0;
|
||||
}
|
1
plugins/jetpack/modules/omnisearch/omnisearch.min.css
vendored
Normal file
1
plugins/jetpack/modules/omnisearch/omnisearch.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
h2.page-title small{font-size:.6em;font-weight:300;font-style:italic;opacity:.6;margin-left:.5em}form.omnisearch-form{position:relative}input.omnisearch{border-radius:.25em;font-size:2.2em;line-height:1.35;padding:.25em 2em .25em .5em;width:100%}input.omnisearch::-webkit-search-cancel-button{display:none}button.omnisearch-submit{background:0 0;border:0;cursor:pointer;display:block;font-size:2.45em;padding:.3em .5em .1em;text-align:center;position:absolute;right:0;bottom:0}button.omnisearch-submit::before{font-family:Genericons,Noticons;content:'\f400'}button.omnisearch-submit span{display:none}#results-title,.jump-to{font-size:1.2em;line-height:1.5;float:left;margin-top:0;padding-top:2em}#results-title,.jump-to strong{font-weight:600}.jump-to{float:right;text-align:right}.jump-to a,.jump-to strong{color:inherit;margin-left:.5em;text-decoration:none}.jump-to a:hover{text-decoration:underline}.back-to-top{display:block;float:right;margin-top:2.5em}.omnisearch-results>li{padding-top:2.5em}.omnisearch-results>li:first-child{padding-top:0}.omnisearch-results .add-new-h2{display:inline}.wp-list-table .column-snippet{width:65%}.wp-list-table .column-date{width:15%}.wp-list-table.comments .column-author{width:20%}.wp-list-table.media th{white-space:nowrap}.wp-list-table.media .column-parent{width:15%}.wp-list-table.media .column-comments span.vers{display:block}.tablenav{height:0}.omnisearch-results .tablenav.top{margin:5px 0}
|
|
@ -0,0 +1,11 @@
|
|||
/* This file was automatically generated on Sep 29 2014 23:28:15 */
|
||||
|
||||
ul#adminmenu a.wp-has-current-submenu:after,
|
||||
ul#adminmenu > li.current > a.current:after {
|
||||
border-left-color:#8da94c;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child > h2 {
|
||||
text-shadow: none;
|
||||
}
|
132
plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css
Normal file
132
plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css
Normal file
|
@ -0,0 +1,132 @@
|
|||
/* This file was automatically generated on Sep 29 2014 23:28:15 */
|
||||
|
||||
|
||||
h2.page-title small {
|
||||
font-size: 0.6em;
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
opacity: 0.6;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
form.omnisearch-form {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input.omnisearch {
|
||||
border-radius: 0.25em;
|
||||
font-size: 2.2em;
|
||||
line-height: 1.35;
|
||||
padding: 0.25em 0.5em 0.25em 2em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input.omnisearch::-webkit-search-cancel-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.omnisearch-submit {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 2.45em;
|
||||
padding: 0.3em 0.5em 0.1em;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
button.omnisearch-submit::before {
|
||||
font-family: 'Genericons', Noticons;
|
||||
content: '\f400';
|
||||
}
|
||||
|
||||
button.omnisearch-submit span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to {
|
||||
font-size: 1.2em;
|
||||
line-height: 1.5;
|
||||
float: right;
|
||||
margin-top: 0;
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
#results-title,
|
||||
.jump-to strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.jump-to {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.jump-to strong,
|
||||
.jump-to a {
|
||||
color: inherit;
|
||||
margin-right: 0.5em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.jump-to a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
display: block;
|
||||
float: left;
|
||||
margin-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results {
|
||||
|
||||
}
|
||||
|
||||
.omnisearch-results > li {
|
||||
padding-top: 2.5em;
|
||||
}
|
||||
|
||||
.omnisearch-results > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .add-new-h2 {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wp-list-table .column-snippet {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.wp-list-table .column-date {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.comments .column-author {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.wp-list-table.media th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-parent {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.wp-list-table.media .column-comments span.vers {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tablenav {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.omnisearch-results .tablenav.top {
|
||||
margin: 5px 0;
|
||||
}
|
Reference in a new issue