Coder Social home page Coder Social logo

the-monkeys-and-maud / wordpress-any-word-search Goto Github PK

View Code? Open in Web Editor NEW
1.0 11.0 0.0 128 KB

A very simple WordPress plugin that makes the WordPress search box find posts that contain ANY of the words entered instead of only posts that contain ALL of the words; that is, it makes the search use the OR operator instead of the default AND operator.

PHP 100.00%

wordpress-any-word-search's Introduction

The Monkeys

WordPress Any Word Search Plugin

This is a very simple WordPress plugin that makes the WordPress search box find posts that contain ANY of the words entered instead of only posts that contain ALL of the words; that is, it makes the search use the OR operator instead of the default AND operator.

It doesn't have any settings or configuration - just place the plugin in your /wp-content/plugins/ folder, activate the plugin through the 'Plugins' menu, and searches that have more than one word will start returning posts that contain one (or more) of the words instead of just posts that contain every one of the words.

Download

Download a zip archive of the plugin here.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Please work in a branch so that you can squash your commits into a single commit as you merge into master.

Deploying to WordPress Plugin Directory

You would have already cloned the repo from github:

git clone https://github.com/TheMonkeys/WordPress-Any-Word-Search.git

Configuring the Subversion "remote"

To be able to deploy to the WordPress Plugin Directory you'll need to tell git about the subversion repo. This only needs to be done once on your working copy.

Note: The -r689532 in the fetch command below is the first revision of our plugin. If you leave that out Git will have to search through the entire history of the repository. That’s over 500,000 revisions.:

    cd WordPress-Any-Word-Search/
    git svn init --stdlayout --no-minimize-url --username=${YOUR_WORDPRESS_ORG_USERNAME} http://plugins.svn.wordpress.org/any-word-search/
    git svn fetch -r689532:HEAD

Pushing to Subversion

Now follow steps 5 and on from http://wp.tutsplus.com/tutorials/plugins/publishing-wordpress-plug-ins-with-git/:

    git checkout master
    git merge --squash work
    git commit -a -m "Your commit message here"
    git branch -D work
    git push -u origin master
    git svn rebase
    git svn dcommit
    git svn tag "2.0"

wordpress-any-word-search's People

Contributors

felthy avatar

Stargazers

Sebastian Ortiz avatar

Watchers

Toby avatar James Cloos avatar  avatar  avatar Mitermayer Reis avatar Han Lee avatar Jono avatar  avatar Lachalino avatar  avatar  avatar

wordpress-any-word-search's Issues

Simpler alternate method?

Possibly more a comment than an issue? For some reason the code just didn't work for me, but this variant did:

$search = preg_replace( '#\)[[:space:]]+AND[[:space:]]+\(#', ') OR (', $search );

It seems simpler too. Am I missing something? Seems to work so far - I'll report back if I find problems. Anyway, thanks for getting me in the right direction!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.