How to find a spam link?

Did you try a search from the Posts (Admin) screen? (And also the Pages (Admin) screen? And sometimes a googles of your site might find it: use something like search-term site:example.com …depends on how current the googles are for your site. But sometimes works well. Added To answer your question/comment: Remember that there is no … Read more

Can’t access wp-admin, redirects to http://%24domain/wp-admin/

first of all you shouldnt delete .htaccess file. create another one in the root directory and add following lines to it: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress then go to wp-config.php and add these … Read more

Add term of current custom post type to admin body class using admin_body_class

I think you’re missing get_current_screen(). add_filter( ‘admin_body_class’, ‘rw_admin_body_class’ ); function rw_admin_body_class( $classes ) { $screen = get_current_screen(); if ( ‘post’ != $screen->base ) { return $classes; } global $post; $terms = wp_get_post_terms( $post->ID, ‘product_cat’, array( ‘fields’ => ‘all’ ) ); $terms = wp_list_pluck( $terms, ‘slug’ ); foreach ( $terms as $term ) { $classes .= … Read more

How to log out from admin or front-end only?

There is no such thing like ‘logout from dashboard/backend’ or ‘logout from front end’. When you log out then certain cookies are cleared from your browser. Log out is for all of the pages (both for front end and back end).

How to pass multiple parameter in add_action()

If you need to call enqueue_assets at admin_init, then add a new add_action(): add_action( ‘admin_init’, [$this, ‘settings_page_registration’] ); add_action( ‘admin_init’, [$this, ‘enqueue_assets’] ); https://developer.wordpress.org/reference/functions/add_action/ That said, if your assets are JS scripts or CSS, you should consider wp_enqueue_script() & wp_enqueue_scripts https://developer.wordpress.org/reference/functions/wp_enqueue_script https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/

Accessing variable from admin panel?

Read the codex page on creating options pages, and let us know if you run into any specific issues. It has a complete copy/paste example you can monkey with. If you’re trying to avoid learning WordPress’ options mechanisms in favor of a more generic custom php solution, I understand where you’re coming from, but recommend … Read more