Plugin Directory

Changeset 2464160


Ignore:
Timestamp:
01/28/2021 10:28:25 AM (5 years ago)
Author:
theode
Message:

Make Plugin ready for years to come

Location:
label-plugins/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • label-plugins/trunk/label-plugins.php

    r1529257 r2464160  
    44Plugin URI: http://wordpress.org/plugins/label-plugins
    55Description: Did you ever struggle with multiple plugins, now you have chance to label them.
    6 Author: wp-plugin-dev.com
    7 Version: 0.4
    8 Author URI: http://www.wp-plugin-dev.com/
     6Author: emojized
     7Version: 0.5
     8Author URI: https://emojized.com/
    99*/
    1010
  • label-plugins/trunk/lp_admin_page.php

    r1529257 r2464160  
    11<?php
     2/**
     3* Class and Function List:
     4* Function list:
     5* - label_plugin_menu()
     6* - initial_plugin_labels()
     7* - label_plugins_options()
     8* Classes list:
     9*/
    210add_action('admin_menu', 'label_plugin_menu');
    311
    412function label_plugin_menu()
    513{
    6     add_options_page( __('Plugin').'-'.__('Tags'), __('Plugin').'-'.__('Tags'), "delete_users", "label-plugins", "label_plugins_options");
     14    add_options_page(__('Plugin') . '-' . __('Tags') , __('Plugin') . '-' . __('Tags') , "delete_users", "label-plugins", "label_plugins_options");
    715}
    816
     
    1018function initial_plugin_labels()
    1119{
    12     $labels=get_option("plugin_labels");
    13     //if ($labels==""){
    14     $labels = array(label1 => __("good"), label2 => ("average"), label3 => ("bad"), add_plugin_labels => "");
    15     update_option("plugin_labels", $labels);
    16     //}
     20    $labels = get_option("plugin_labels");
     21    //if ($labels==""){
     22    $labels = array(
     23        label1 => __("good") ,
     24        label2 => ("average") ,
     25        label3 => ("bad") ,
     26        add_plugin_labels => ""
     27    );
     28    update_option("plugin_labels", $labels);
     29    //}
     30   
    1731}
    1832
    1933function label_plugins_options()
    2034{
    21     if
    22     (isset($_POST['add_plugin_labels']))
    23     {
    24         update_option( "plugin_labels", $_POST);
    25     }else if
    26         ($_GET[reset]==1)
    27         {
    28             delete_option( "plugin_labels" );
    29         }
    30     else
    31     {
    32        
    33     }
    34     $labels=get_option("plugin_labels" );
    35    
     35    if (isset($_POST['add_plugin_labels']))
     36    {
     37        update_option("plugin_labels", $_POST);
     38    }
     39    $labels = get_option("plugin_labels");
     40
    3641?>
    3742<div class="wrap">
    3843<?php screen_icon();
    3944?>
    40 <h2><?php _e('Plugin'); echo '-'; _e("Tags");
    41     ?></h2>
     45<h2><?php _e('Plugin');
     46    echo '-';
     47    _e("Tags");
     48?></h2>
    4249<div id="container">
    4350
     
    4653<form method="POST" action="">
    4754<?php
    48     $num=1;
    49     $count=count($labels);
    50     foreach ($labels as $key => $value)
    51     {
    52         if
    53         ($num<$count)
    54         {
     55    $num = 1;
     56   
     57    if(empty($labels))
     58    {
     59        initial_plugin_labels();
     60    }
     61    $count = count($labels);
     62    foreach ($labels as $key => $value)
     63    {
     64        if ($num < $count)
     65        {
    5566?>
    5667<p><label for="var<?php echo $num;
    57             ?>"><?php _e('Label'); ?>: </label><input type="text" name="label<?php echo $num;
    58             ?>" id="var<?php echo $num;
    59             ?>" value="<?php echo $value;
    60             ?>" /><span class="removeVar button"><?php _e('Remove'); ?> <?php _e('Label'); ?></span></p>
    61 <?php }else
    62             {} $num++;
    63     } ?>
     68?>"><?php _e('Label'); ?>: </label><input type="text" name="label<?php echo $num;
     69?>" id="var<?php echo $num;
     70?>" value="<?php echo $value;
     71?>" /><span class="removeVar button"><?php _e('Remove'); ?> <?php _e('Label'); ?></span></p>
     72<?php
     73        }
     74       
     75        $num++;
     76    } ?>
    6477<p>
    6578<span  class="button button-small" id="addVar"><?php _e('Add'); ?> <?php _e('Label'); ?></span>
     
    7083        </form>
    7184    <?php //echo "num1 ".$num1;
     85   
    7286?>
    7387    </div><!--!/#container -->
     
    7589    //create three initial fields
    7690var startingNo = <?php echo $num;
    77     ?>;
     91?>;
    7892var node = "";
    7993for(varCount=0;varCount<=startingNo;varCount++){
  • label-plugins/trunk/readme.txt

    r1529257 r2464160  
    11=== Label Plugins ===
    22Contributors: theode
    3 Donate link: http://www.wp-plugin-dev.com/donate
     3Donate link: -
    44Tags: categories, category, development, label, labeling,
    55Requires at least: 3.0
    6 Tested up to: 4.7
    7 Stable tag: 0.4
     6Tested up to: 5.7
     7Stable tag: 0.5
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4242== Changelog ==
    4343
     44= 0.5 =  small bugfixes, WordPress 5.7 ready
    4445= 0.3 =  bug removed standard plugin statuses
    4546= 0.2 =  Dynamic labels in backend
Note: See TracChangeset for help on using the changeset viewer.