Support » Plugin: Post Tags and Categories for Pages » Complete Post Tags and Categories for Pages

  • Resolved Mick83


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

    So I added this code before :

    function atcp_create_menu() {
    add_options_page('Activ Tags/Cat Pages', 'Activ Tags/Cat Pages', 'administrator', __FILE__, 'ptcfp_settings_page');
    	add_action('admin_init', 'register_atcpsettings');
    add_action('admin_menu', 'ptcfp_create_menu');
    function register_atcpsettings() {
    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($atcp_add_tags)){
    update_option('ptcfp_add_tags', 'no');
    $ptcfp_add_tags	= get_option('ptcfp_add_tags');
    if (empty($ptcfp_add_cat)){
    update_option('atcp_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>
    <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>
    <tr valign="top">
    <th scope="row">Catégorie pour les pages ?</th>
    <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>
    <p class="submit">
    <input type="submit" name="submit-ptcfp" class="button-primary" value="<?php _e('Save Changes') ?>" />
    class PTCFP {
    $ptcfp = new PTCFP();

    [Please use the backticks when posting code here]

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

    I’m still a beginner.
    Thank you in advance.

Viewing 1 replies (of 1 total)
  • See other “Complete Post Tags and Categories for Pages” message because it contains errors.
    thank you

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