|
|
@@ -60,8 +60,8 @@ add_action('updated_option', 'gwp24_browsersync_save', 10, 3);
|
|
|
************************************************************/
|
|
|
|
|
|
function gwp24_enqueue_assets() {
|
|
|
- //wp_enqueue_script ( 'site-js', get_template_directory_uri() . '/js/site.js' );
|
|
|
- //wp_enqueue_style( 'site-css', get_template_directory_uri() . '/css/site.css');
|
|
|
+ wp_enqueue_script ( 'site-js', get_template_directory_uri() . '/js/site.js' );
|
|
|
+ wp_enqueue_style( 'site-css', get_template_directory_uri() . '/css/site.css');
|
|
|
}
|
|
|
add_action( 'wp_enqueue_scripts', 'gwp24_enqueue_assets' );
|
|
|
|
|
|
@@ -233,11 +233,14 @@ function gwp24_remove_adminbar( $wp_admin_bar ) {
|
|
|
$wp_admin_bar->remove_node( 'view-site' );
|
|
|
}
|
|
|
|
|
|
-add_filter( 'gettext', 'gwp24_change_howdy', 10, 2 );
|
|
|
-function gwp24_change_howdy( $translation, $original ) {
|
|
|
- if( 'Howdy, %1$s' == $original )
|
|
|
- $translation = '%1$s';
|
|
|
- return $translation;
|
|
|
+add_filter( 'admin_bar_menu', 'gwp24_replace_wordpress_howdy', 25 );
|
|
|
+function gwp24_replace_wordpress_howdy( $wp_admin_bar ) {
|
|
|
+ $account = $wp_admin_bar->get_node('my-account');
|
|
|
+ $newtext = str_replace( 'Howdy,', '', $account->title );
|
|
|
+ $wp_admin_bar->add_node( array(
|
|
|
+ 'id' => 'my-account',
|
|
|
+ 'title' => $newtext,
|
|
|
+ ));
|
|
|
}
|
|
|
/* for email */
|
|
|
add_filter( 'gettext', 'gwp24_change_howdy_text', 10, 2 );
|
|
|
@@ -494,4 +497,42 @@ function fix_svg() {
|
|
|
}
|
|
|
</style>';
|
|
|
}
|
|
|
-add_action( 'admin_head', 'fix_svg' );
|
|
|
+add_action( 'admin_head', 'fix_svg' );
|
|
|
+
|
|
|
+
|
|
|
+/***********************************************************
|
|
|
+################## Modified Dates ##########################
|
|
|
+************************************************************/
|
|
|
+
|
|
|
+function custom_modified_date_column($defaults) {
|
|
|
+ $defaults['modified_date'] = 'Modified Date';
|
|
|
+ return $defaults;
|
|
|
+}
|
|
|
+function custom_modified_date_column_content($column_name, $post_ID) {
|
|
|
+ if ($column_name == 'modified_date') {
|
|
|
+ $modified_date = get_post_field('post_modified', $post_ID);
|
|
|
+ $formatted_date = date_i18n('Y/m/d \a\t g:i a', strtotime($modified_date));
|
|
|
+ echo 'Modified ' . '<br>' . esc_html($formatted_date);
|
|
|
+ }
|
|
|
+}
|
|
|
+function custom_modified_date_column_sortable($columns) {
|
|
|
+ $columns['modified_date'] = 'modified_date';
|
|
|
+ return $columns;
|
|
|
+}
|
|
|
+function custom_sortable_columns_orderby($query) {
|
|
|
+ if (!is_admin() || !$query->is_main_query()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $orderby = $query->get('orderby');
|
|
|
+ if ($orderby == 'modified_date') {
|
|
|
+ $query->set('orderby', 'modified');
|
|
|
+ $query->set('order', 'desc'); // Set the order to descending
|
|
|
+ }
|
|
|
+}
|
|
|
+add_filter('manage_posts_columns', 'custom_modified_date_column');
|
|
|
+add_action('manage_posts_custom_column', 'custom_modified_date_column_content', 10, 2);
|
|
|
+add_filter('manage_pages_columns', 'custom_modified_date_column'); // Add this line to include the column in pages list
|
|
|
+add_action('manage_pages_custom_column', 'custom_modified_date_column_content', 10, 2);
|
|
|
+add_filter('manage_edit-post_sortable_columns', 'custom_modified_date_column_sortable'); // Add this line to make the column sortable in posts list
|
|
|
+add_filter('manage_edit-page_sortable_columns', 'custom_modified_date_column_sortable'); // Add this line to make the column sortable in pages list
|
|
|
+add_action('pre_get_posts', 'custom_sortable_columns_orderby');
|