WordPress custom avatar no plugin: media-library uploader on user profile + user meta + get_avatar filter. Full functions.php + uploader.js…
WordPress pre_get_posts custom post type: scope the hook with is_post_type_archive or post_type query var. Mandatory guards, merge meta_query/tax_query.
WordPress logged-in menu: register two nav locations and pick via is_user_logged_in() ternary. Plus the wp_nav_menu_objects filter for lighter item-level swaps.
WordPress disable revision with WP_POST_REVISIONS false + AUTOSAVE_INTERVAL in wp-config. Per-post-type via wp_revisions_to_keep filter, plus WP-CLI cleanup.
WordPress wpdb insert_id: read after $wpdb->insert() or $wpdb->query('INSERT ...'). Bulk-insert semantics, safety checks, and why it replaces mysql_insert_id.
WordPress prepare LIKE: use %s in the query and wrap the value with % wildcards. Covers esc_like() for user input,…
WordPress order posts by meta value with meta_key + orderby=meta_value_num in WP_Query or pre_get_posts. Including no-meta posts with EXISTS/NOT EXISTS.
WordPress search users across user_login, email, display_name via WP_User_Query search_columns. Add meta_query for first_name / last_name, plus pagination.
WordPress current category ID with get_queried_object on archives, get_the_category on singles, and get_cat_ID by name. Safe guards for non-archive pages.
WordPress check user logged in with is_user_logged_in(). Covers nav menu switching, capability checks, and the timing gotcha when calling from…
Sign in to your account