Plugin Directory

Changeset 458324


Ignore:
Timestamp:
11/01/2011 04:10:53 PM (14 years ago)
Author:
SimonaIlie
Message:

search in wordpress custom fields

Location:
search-simple-fields
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • search-simple-fields/trunk/functions_admin.php

    r458180 r458324  
    1919        $media_function             = (isset($_POST[SSF_MEDIA_FUNCTION])) ? $_POST[SSF_MEDIA_FUNCTION] : '';
    2020        $media_fields               = (isset($_POST['media_fields']) && array_filter($_POST['media_fields'])) ? $_POST['media_fields'] : null;
     21        $wp_fields                  = (isset($_POST['wp_fields']) && trim($_POST['wp_fields']) != '') ? explode(';', $_POST['wp_fields']) : null;
    2122        if(!is_null($post_types_for_search))
    2223            update_option(SSF_POST_TYPES_FOR_SEARCH, $post_types_for_search);
     
    3637        else
    3738            delete_option(SSF_MEDIA_FIELDS_FOR_SEARCH);
     39
     40        if(!is_null($wp_fields))
     41            update_option(SSF_WP_FIELDS_FOR_SEARCH, $wp_fields);
     42        else
     43            delete_option(SSF_WP_FIELDS_FOR_SEARCH);
    3844    endif;
    3945    $old_post_types = get_option(SSF_POST_TYPES_FOR_SEARCH);
     
    108114        <?php endif;
    109115    endif; ?>
    110     <?php _e('Custom function you use to define custom media fields');?>: <input type="text" name="<?php echo SSF_MEDIA_FUNCTION;?>" size="40" value="<?php echo $media_function;?>"/>   
     116    <?php _e('Custom function you use to define custom media fields');?>: <input type="text" name="<?php echo SSF_MEDIA_FUNCTION;?>" size="40" value="<?php echo $media_function;?>"/>
    111117    </div>
     118    <div class="ssf-horizontal-line"><!-- --></div>
     119    <?php $old_wp_fields = get_option(SSF_WP_FIELDS_FOR_SEARCH); ?>
     120    <div class="ssf-list-title"><?php _e('WordPress custom fields'); ?></div>
     121    <p class="ssf-paragraph"><?php _e('Please write the custom fields\' names separated by semicolo (;).');?></p>
     122    <textarea cols="50" rows="2" name="wp_fields"><?php echo (isset($old_wp_fields) && is_array($old_wp_fields)) ? implode(';', $old_wp_fields): ''; ?></textarea>
    112123    <input type="submit" value="Save Changes" name="save-changes"/>
    113124    </form>
  • search-simple-fields/trunk/readme.txt

    r458180 r458324  
    55Requires at least: 3.2.1
    66Tested up to: 3.2.1
    7 Stable tag: 0.1
     7Stable tag: 0.2
    88
    99Set custom fields to apply the Wordpress Search on.
     
    5353- First beta version.
    5454
     55= 0.2 =
     56- Added possibility to search in WordPress custom fields too
     57
  • search-simple-fields/trunk/search_simple_fields.php

    r458180 r458324  
    44Plugin URI: http://elfdreamer.blogspot.com/2011/10/new-wordpress-plugin-search-simple.html
    55Description: Allows user to search in different cusomt fields. It extends this plugin: <a href='http://eskapism.se/code-playground/simple-fields/' target='_blank'>Simple Fields</a>. Also let the user choose from Media custom fields or Wordpress custom fields.
    6 Version: 0.1
     6Version: 0.2
    77Author: SimonaIlie
    88Author URI: http://elfdreamer.blogspot.com/
Note: See TracChangeset for help on using the changeset viewer.