Disable Password Reset

// Disable Password Reset Functionality function disable_password_reset() { return false; } add_filter(‘allow_password_reset’, ‘disable_password_reset’); // Remove “Lost Your Password?” Link function remove_lostpassword_text($text) { if ($text == ‘Lost your password?’) { $text = ”; } return $text; } add_filter(‘gettext’, ‘remove_lostpassword_text’); // Block…Continue reading

Show User ID

// 1. Add the ID column after the Username column function add_user_id_column($columns) { $new_columns = array(); foreach ($columns as $key => $value) { $new_columns[$key] = $value; // Insert ‘user_id’ column right after ‘username’ if ($key === ‘username’) { $new_columns[‘user_id’] =…Continue reading

List Media Information

// 1. Add Columns to Media Library function add_media_library_columns( $columns ) { $columns[‘media_format’] = ‘Format’; $columns[‘dimensions’] = ‘Dimensions’; $columns[‘file_size’] = ‘File Size’; return $columns; } add_filter( ‘manage_media_columns’, ‘add_media_library_columns’ ); // 2. Display Data in Columns function display_media_library_column_data( $column_name, $post_id )…Continue reading

Reorder Post Column

add_filter(‘manage_posts_columns’, ‘reorder_admin_columns’); function reorder_admin_columns($columns) { $n_columns = array(); $move = ‘author’; // Column to move $before = ‘title’; // Move before this column foreach($columns as $key => $value) { if ($key == $before) { $n_columns[$move] = $move; } $n_columns[$key] =…Continue reading

Protect Admin User

class Protected_User { // Select capabilities from the default ‘Administrator’ role public function __construct() { add_filter(‘editable_roles’, array($this, ‘filter_editable_roles’)); add_filter(‘map_meta_cap’, array($this, ‘filter_map_meta_cap’), 10, 4); } // Remove ‘Administrator’ role if the current user is not a protected user public function filter_editable_roles($roles)…Continue reading

Expand the Edit Abilities

use Elementor\Controls_Manager; use Elementor\Group_Control_Background; function add_background_and_overlay_to_layout_tab($element, $args) { // === NORMAL BACKGROUND === $element->start_controls_section( ‘custom_background_layout’, [ ‘label’ => __(‘Background (Layout Tab)’, ‘textdomain’), ‘tab’ => Controls_Manager::TAB_LAYOUT, ] ); $element->add_group_control( Group_Control_Background::get_type(), [ ‘name’ => ‘custom_background’, ‘label’ => __(‘Background’, ‘textdomain’), ‘types’ => [‘classic’,…Continue reading

[Hunters Hill Trust] House Count Dynamic Data Shortcode

function rd_greenbook_house_count_shortcode() { $counts = wp_count_posts( ‘wpsl_stores’ ); return isset( $counts->publish ) ? esc_html( number_format_i18n( (int) $counts->publish ) ) : ‘0’; } add_shortcode( ‘rd_greenbook_house_count’, ‘rd_greenbook_house_count_shortcode’ );Continue reading