• Resolved mkdes

    (@mkdes)


    Hello. How to search into custom post types?

    [EDIT]

    I found this part of code.

    'post_type' => array( 'post', 'page' ),

    But generally plugin doesn’t work.
    Neither for custom post types, neither post and pages.
    There is problem with “-” and “–” into posts titles.

    • This topic was modified 1 year, 1 month ago by mkdes.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter mkdes

    (@mkdes)

    This is because this code replace short dash “-” and long dash “–” to the same entitie: –

    Solution is NOT USE dash into title.

    $attached = filter_input( INPUT_GET, 'maf_attached', FILTER_SANITIZE_FULL_SPECIAL_CHARS );

    There is the area to improve plugin when user use short dash “-” and long dash “–” into post title.

    • This reply was modified 1 year, 1 month ago by mkdes.
    Plugin Author threadi

    (@threadi)

    Hello,

    Thank you for your interest in this little plugin. I will take a look at your suggestions when I get a chance and get back to you.

    Thread Starter mkdes

    (@mkdes)

    I write this coda as temporary solution.
    But this is only temporary, because dash is also change from short to long into media library filter fileld.

    $attached = strip_tags( $_GET[‘maf_attached’] );
    $attached = htmlspecialchars( $attached, ENT_QUOTES, ‘UTF-8’ );
    $attached = str_replace( ‘–’, ‘-‘, $attached ); // this is because probably search field change dash

    Plugin Author threadi

    (@threadi)

    Check out the new version 1.2.0 🙂

    Thread Starter mkdes

    (@mkdes)

    Thank You for fast update.
    But it need more improve.
    When user start typing part of post title, the dropdownl list contains many titles with different dash length.
    Maybe this are the revisions.
    No matter what user chose, plugin not find post attachments.

    See this image https://imgur.com/a/8nVfVXs

    Plugin Author threadi

    (@threadi)

    Check out the latest update to 1.2.1. Among other things, revisions are excluded. There is now also a hook that can be used to filter the permitted post types, if necessary.

    Thread Starter mkdes

    (@mkdes)

    Now works great. Thank You 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘How to search into custom post types’ is closed to new replies.