Admin Area Custom Type Search By Meta Fields Without Title & Content

I have a custom post type that uses several meta fields. In the admin area I would like to be able to search by those meta fields. I have implemented this currently in my functions.php with this code:

function custom_search_query( $query ) {
  if ( is_admin() && is_main_query() && $query->is_search ) {
    $query->set('meta_query', array(
      "relation" => "OR",
      array(
        'key' => 'first_name',
        'value' => $query->query_vars['s'],
        'compare' => 'LIKE'
      ),
      array(
        'key' => 'last_name',
        'value' => $query->query_vars['s'],
        'compare' => 'LIKE'
      ),
      array(
        'key' => 'email',
        'value' => $query->query_vars['s'],
        'compare' => 'LIKE'
      )
    ));
    $query->set('post_type', 'application'); // optional
  };
}
add_filter( 'pre_get_posts', 'custom_search_query');

The problem is that with those code if I search for say the name “walker” and I have records of my custom post type that match that criteria in the meta field I get back no results. The reason this appears to be happening is that the SQL that is being generated by the query that gets executed is this:

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts 
INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)
INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)
INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) WHERE 1=1
AND (((wp_posts.post_title LIKE '%walker%') OR (wp_posts.post_content LIKE  '%walker%'))) 
AND wp_posts.post_type = 'application' AND (wp_posts.post_status =  'publish' 
OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' 
OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')
AND ((wp_postmeta.meta_key = 'first_name' AND CAST(wp_postmeta.meta_value AS CHAR) LIKE  '%walker%')
OR (mt1.meta_key = 'last_name' AND CAST(mt1.meta_value AS CHAR) LIKE '%walker%')
OR (mt2.meta_key = 'email' AND CAST(mt2.meta_value AS CHAR) LIKE '%walker%') )   
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 20

The query is attempting to search both the post title and content AND my custom fields. I don’t want it to be looking for matches in the title or content. How can I get the query to stop doing that and thereby returning the restuls that aI want?

magento 2 custom api return in json without response tag

I have created a custom api following “inchoo” tutorial. But I am getting the data in string format instead of json.

From my browser I am getting a tag surrounding the api return as below.
enter image description here
But Chrome’s postman extension showing a double quote (“”) and some extra slashes () in the in the response even after header to “Accept”:”application/json” and “Content-Type”:”application/json”.
enter image description here
I just want to receive the exact same string I am returning in my Model class.

 public function name() {
    //return "Hello, raihanruhin";
    $arr = '[{"name":"MasterCard"},{"name":"VISA"}, {"name":"DBBL-NEXUS"}, {"name":"American Express"}]';
    return $arr;
}

Change Windows Live ID Without Resetting The Phone [ROOT]

My phone is rooted HTC HD7 running WP 7.8 and I have an app called WP7 Root Tools By HeathCliff74 which gives me a File Explorer and Registry Browser and I want to change the Windows Live ID on my phone without resetting my phone because I’m giving my phone away to a family and I have lots of useful apps etc. Is there any way to do this?

What do sentences without adjectival complements refer to?

This event is very exciting.

This event is very exciting to me.

“To me” is an adjectival complement to “exciting,” so the two sentences can’t be the same. However, if that’s the case, what does the event excite in the first sentence? I have thought that it refers to people in general, but if the sentence is changed to past tense like in “this event was very exciting” I am not sure if it still refers to people in general or a specific group.

Ajax page load without reload

I am working on a script to load my page without refreshing. It is working as I want it except for one thing. The test site I have up is http://dev.dog-company.com . Only home About us and FAQ will work with the script right now.

The issue is on the homepage there is a slider loaded via a plugin(click on home while on home). When I load it via AJAX my script does not load it the proper way it is supposed to. I am not sure why. Could someone explain why it is not working?

$('document').ready(function() {
$('a[rel="load"]').click(function(e){
    e.preventDefault();
    var link = $(this).attr("href");
    if(link!=window.location){
                window.history.pushState({path:link},'',link);
    }
    $('#slider-wrapper').slideUp().empty();
    $('#content').wrap('
'); $.ajax({ //ajax setting type: 'POST', url: link, dataType: 'html', success : function(data, text, xhr){ //parse data var response = $("
").html(data); var parser = new DOMParser(); var preParse = data.match(/]*>[sS]*/gi); var headHTML = parser.parseFromString(preParse, "text/html"); var head = $(headHTML).find('head').html(); var slider = response.find('#slider-wrapper').html(); var content = response.find('#content').html(); var footer = response.find('#wp-footer').html(); //Post data $('#content').empty().append(content); $('head').empty().append(head); if(slider != null){ if($("#slider-wrapper").length == 0){ $('#content').insertBefore('
'); } $("#slider-wrapper").empty().append(slider); } $("#content").empty().append(content); return false; }}) if($('#slider-wrapper').length > 0){ $('#slider-wrapper').slideDown(); } }); });

Any help would be appreciated,

Add submenu without using add_submenu_page?

Is it possible to have add a submenu to an exiting menu with using add_submenu_page without knowing the parent slug?

add_action( 'admin_menu', 'main_home' );


    function main_home() {
        add_submenu_page(
            'general-settings',
            __( 'Books Shortcode Reference', 'textdomain' ),
            __( 'Shortcode Reference', 'textdomain' ),
            'manage_options',
            'admin.php?page=general-settings-new',
            'books_ref_page_callback'
        );
    }


    function books_ref_page_callback() { 
        ?>
        

in above code : admin.php?page=general-settings-new redirects makes the subemenu url to website.com/wp-admin/admin.php?page=general-settings-new but it will endup in Sorry, you are not allowed to access this page.

i want to make general-settings-new to work somehow.

if i just use general-settings-new instead of admin.php?page=general-settings-new url will change like website.com/general-settings-new

Please suggest a method i go for.

Backup/dump kernel image without root

I would like to pull the boot image of my device Pipo N7. I don’t have root.
I found the following link:

Backup/dump kernel image without root or twrp/cwm`

But when I try to find /dev -name 'by-name' 2>/dev/null I can’t get it to work it seems I need root.

Is there any other way to get the boot image pulled without root?

P.S. I would have commented on that link but I’m not allowed to since I don’t have enough reputation.