• Hello,
    I try to add to your plugin, a choice of options Tags or / and Cat.

    So I added this code before :
    <?php
    function ptcfp_create_menu() {
    add_options_page(‘Activ Tags/Cat Pages’, ‘Activ Tags/Cat Pages’, ‘administrator’, __FILE__, ‘ptcfp_settings_page’);
    add_action(‘admin_init’, ‘register_ptcfpsettings’);
    }
    add_action(‘admin_menu’, ‘ptcfp_create_menu’);
    function register_ptcfpsettings() {
    register_setting(‘ptcfp-settings-group’, ‘ptcfp_add_tags’);
    register_setting(‘ptcfp-settings-group’, ‘ptcfp_add_cat’);
    }
    function ptcfp_settings_page() {
    $ptcfp_add_tags = get_option(‘ptcfp_add_tags’);
    $ptcfp_add_cat = get_option(‘ptcfp_add_cat’);
    if (empty($ptcfp_add_tags)){
    update_option(‘ptcfp_add_tags’, ‘no’);
    $ptcfp_add_tags = get_option(‘ptcfp_add_tags’);
    }
    if (empty($ptcfp_add_cat)){
    update_option(‘ptcfp_add_cat’, ‘no’);
    $ptcfp_add_cat = get_option(‘ptcfp_add_cat’);
    }
    ?>
    <div class=”wrap”>
    <h2>Activation des mots-clés et/ou catégorie pour les pages</h2>
    <form method=”post” action=”options.php”>
    <?php settings_fields( ‘ptcfp-settings-group’ ); ?>
    <table class=”form-table”>
    <tr valign=”top”>
    <th scope=”row”>Mots-clés pour les pages ?</th>
    <td>
    <select name=”ptcfp_add_tags” />
    <option value=”yes” <?php echo $ptcfp_add_tags == ‘yes’?’selected=”selected”‘:”; ?>>Oui</option>
    <option value=”no” <?php echo $ptcfp_add_tags == ‘no’?’selected=”selected”‘:”; ?>>Non</option>
    </select>
    </td>
    </tr>
    <tr valign=”top”>
    <th scope=”row”>Catégorie pour les pages ?</th>
    <td>
    <select name=”ptcfp_add_cat” />
    <option value=”yes” <?php echo $ptcfp_add_cat == ‘yes’?’selected=”selected”‘:”; ?>>Oui</option>
    <option value=”no” <?php echo $ptcfp_add_cat == ‘no’?’selected=”selected”‘:”; ?>>Non</option>
    </select>
    </td>
    </tr>
    </table>
    <p class=”submit”>
    <input type=”submit” name=”submit-ptcfp” class=”button-primary” value=”<?php _e(‘Save Changes’) ?>” />
    </p>
    </form>
    </div>
    <?php
    }
    class PTCFP {

    $ptcfp = new PTCFP();
    ?>

    I can not spend the parameters $ptcfp_add_tags and $ptcfp_add_cat in class PTCFP to then test the option.

    How?
    I’m still a beginner.
    Thank you in advance.
    Michel

    http://wordpress.org/plugins/post-tags-and-categories-for-pages/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author curtismchale

    (@curtismchale)

    As I understand it you are trying to add an options panel to the plugin so that a user can choose to add the Tags and Categories (one or both or either).

    I don’t have any interest in adding that to the plugin.

    If you want to add a settings page then you should follow this tutorial by Tom (http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-1/).

    I don’t provide support for features that I have no interest in.

    Thread Starter Mick83

    (@mick83)

    Hello Curtis,

    You are severe with me, but I will work the subject.
    It is true that this option has no interest, but it is an opportunity to study some classes in plugins.
    Otherwise your plugin, coded in basic PHP works fine with the option.

    Pleasure.
    Thank.
    Michel

    (I am french)

    Plugin Author curtismchale

    (@curtismchale)

    Sorry you feel that way, I’m just being honest. I won’t ever add the feature.

    I did take the time to find you a great tutorial on the subject so that you could accomplish what you want.

    I just don’t have the extra time in my day to assist you to learn how to build this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Complete/ change Post Tags and Categories for Pages’ is closed to new replies.