New answers tagged

0

The best approach, from my point of view, is to use add_query_arg() function: $only_conent_url = add_query_arg( array( 'content-only' => 1 ), get_permalink( $post->ID ) ); And then you can escape it if you need: esc_url( $only_conent_url ); add_query_arg() takes the URL passed as second paramenter and append a properly formatted query string ...


1

I've been running a highly automated WordPress site with more than 8,500 posts for a year now and my permalink structure of choice is /%post_id%/%author%/%postname%/ This means I can recategorize posts without affecting my permalink and never have to worry if I do something behind the scenes the permalink to a post will never become broken (404 error) and ...


1

The WP_Query class can match IDs as well as search terms. An idea would be to use the pre_get_posts action to detect if the search term is numeric and, if it is, set the query to work with attachments while passing the search as the ID. function wpse223307_allow_search_by_attachment_id( $query ) { //Only alter the query if we are in a search screen,... ...


-1

You can only get this email and verify if there is any user have this email then change this email by the correspond username like this $login ='anything@me.com'; if(is_email( $login )){ if( email_exists( $login )) { $userID__ = email_exists($login); $user_info_kim = get_userdata($userID__); $login = ...



Top 50 recent answers are included