| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace PXLBSAdminify\Inc\Classes; | |
| 3 | +namespace WPAdminify\Inc\Classes; | |
| 4 | 4 | |
| 5 | -use PXLBSAdminify\Inc\Utils; | |
| 5 | +use WPAdminify\Inc\Utils; | |
| 6 | 6 | |
| 7 | 7 | // no direct access allowed |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 9 | exit; |
| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 9 | exit; |
| 10 | 10 | } |
| 11 | 11 | /** |
| 12 | - * PXLBSAdminify | |
| 12 | + * WPAdminify | |
| 13 | 13 | * |
| 14 | 14 | * @author Jewel Theme <support@jeweltheme.com> |
| 15 | 15 | */ |
| 16 | 16 | class Hooks { |
| @@ -20,44 +20,44 @@ | ||
| 20 | 20 | // https://wordpress.stackexchange.com/questions/73561/how-to-remove-all-widgets-from-dashboard |
| 21 | 21 | // Hide Screen Options and Contextual Help |
| 22 | 22 | |
| 23 | 23 | // Add Featured Image or Post Thumbnail to RSS Feed |
| 24 | - add_filter( 'the_excerpt_rss', [ $this, 'rss_post_thumbnail' ] ); | |
| 25 | - add_filter( 'the_content_feed', [ $this, 'rss_post_thumbnail' ] ); | |
| 24 | + add_filter( 'the_excerpt_rss', [ $this, 'jltwp_adminify_rss_post_thumbnail' ] ); | |
| 25 | + add_filter( 'the_content_feed', [ $this, 'jltwp_adminify_rss_post_thumbnail' ] ); | |
| 26 | 26 | |
| 27 | 27 | // Add Categories to WordPress Pages, add tag and category support to pages |
| 28 | - add_action( 'init', [ $this, 'tags_categories_support_all' ] ); | |
| 29 | - add_action( 'pre_get_posts', [ $this, 'tags_categories_support_query' ] ); | |
| 28 | + add_action( 'init', [ $this, 'jltwp_adminify_tags_categories_support_all' ] ); | |
| 29 | + add_action( 'pre_get_posts', [ $this, 'jltwp_adminify_tags_categories_support_query' ] ); | |
| 30 | 30 | |
| 31 | 31 | // Remove WordPress Version Number |
| 32 | - add_filter( 'the_generator', [ $this, 'remove_version' ] ); | |
| 32 | + add_filter( 'the_generator', [ $this, 'jltwp_adminify_remove_version' ] ); | |
| 33 | 33 | |
| 34 | 34 | // Remove Default Image Links in WordPress |
| 35 | - add_action( 'admin_init', [ $this, 'imagelink_setup' ], 10 ); | |
| 35 | + add_action( 'admin_init', [ $this, 'jltwp_adminify_imagelink_setup' ], 10 ); | |
| 36 | 36 | |
| 37 | 37 | // WP Adminify Custom Tweaks |
| 38 | - add_filter( 'manage_posts_columns', [ $this, 'columns_attachments' ], 1 ); | |
| 39 | - add_action( 'manage_posts_custom_column', [ $this, 'custom_columns_attachments' ], 1, 2 ); | |
| 38 | + add_filter( 'manage_posts_columns', [ $this, 'jltwp_adminify_columns_attachments' ], 1 ); | |
| 39 | + add_action( 'manage_posts_custom_column', [ $this, 'jltwp_adminify_custom_columns_attachments' ], 1, 2 ); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | - function columns_attachments( $attachmentCount ) { | |
| 43 | + function jltwp_adminify_columns_attachments( $attachmentCount ) { | |
| 44 | 44 | $attachmentCount['wp_adminify_post_attachments'] = esc_html__( 'Attachment(s)', 'adminify' ); |
| 45 | 45 | return $attachmentCount; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - function custom_columns_attachments( $adminify_col_name, $id ) { | |
| 48 | + function jltwp_adminify_custom_columns_attachments( $adminify_col_name, $id ) { | |
| 49 | 49 | if ( $adminify_col_name === 'wp_adminify_post_attachments' ) { |
| 50 | 50 | $attachments = get_children( [ 'post_parent' => $id ] ); |
| 51 | 51 | $adminifyAttachments = count( $attachments ); |
| 52 | 52 | if ( $adminifyAttachments != 0 ) { |
| 53 | - echo esc_html( Utils::kses_custom( $adminifyAttachments ) ); | |
| 53 | + echo Utils::wp_kses_custom( $adminifyAttachments ); | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | - function rss_post_thumbnail( $content ) { | |
| 59 | + function jltwp_adminify_rss_post_thumbnail( $content ) { | |
| 60 | 60 | global $post; |
| 61 | 61 | if ( has_post_thumbnail( $post->ID ) ) { |
| 62 | 62 | $content = '<p>' . get_the_post_thumbnail( $post->ID ) . |
| 63 | 63 | '</p>' . get_the_content(); |
| @@ -65,15 +65,15 @@ | ||
| 65 | 65 | return $content; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | - function tags_categories_support_all() { | |
| 69 | + function jltwp_adminify_tags_categories_support_all() { | |
| 70 | 70 | register_taxonomy_for_object_type( 'post_tag', 'page' ); |
| 71 | 71 | register_taxonomy_for_object_type( 'category', 'page' ); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // ensure all tags and categories are included in queries |
| 75 | - function tags_categories_support_query( $wp_query ) { | |
| 75 | + function jltwp_adminify_tags_categories_support_query( $wp_query ) { | |
| 76 | 76 | if ( $wp_query->get( 'tag' ) ) { |
| 77 | 77 | $wp_query->set( 'post_type', 'any' ); |
| 78 | 78 | } |
| 79 | 79 | if ( $wp_query->get( 'category_name' ) ) { |
| @@ -81,14 +81,14 @@ | ||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | - function remove_version() { | |
| 85 | + function jltwp_adminify_remove_version() { | |
| 86 | 86 | return ''; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | - function imagelink_setup() { | |
| 90 | + function jltwp_adminify_imagelink_setup() { | |
| 91 | 91 | $image_set = get_option( 'image_default_link_type' ); |
| 92 | 92 | |
| 93 | 93 | if ( $image_set !== 'none' ) { |
| 94 | 94 | update_option( 'image_default_link_type', 'none' ); |