Plugin Directory

Changeset 1406772


Ignore:
Timestamp:
04/28/2016 07:36:44 PM (10 years ago)
Author:
mycodingtricks
Message:

Added Few More Option in Admin Panel

Location:
ytsubscribe/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ytsubscribe/trunk/admin/index.php

    r1406540 r1406772  
    2525    register_setting( 'ytSubscribe-settings-group', 'ytSubscribe_layout' );
    2626    register_setting( 'ytSubscribe-settings-group', 'ytSubscribe_dom' );
     27        register_setting( 'ytSubscribe-settings-group', 'ytSubscribe_subscribe_text');
     28        register_setting( 'ytSubscribe-settings-group', 'ytSubscribe_customcss');
    2729}
    2830
     
    3133    $theme = array("default","dark","grey");
    3234    $layout = array("default","full");
     35   
    3336?>
    3437<div class="wrap">
    35 <h2>ytSubcsribe</h2>
     38<h2>ytSubscsribe</h2>
    3639
    3740<form method="post" action="options.php">
     
    9295        <td><input type="text" name="ytSubscribe_dom" value="<?php echo esc_attr( get_option('ytSubscribe_dom',"body") ); ?>" /></td>
    9396        <td>If "<strong>body</strong>" is not working, then replace it to <strong>.single-content</strong> or <strong>.post-single-content</strong></td>
     97        </tr>   
     98        <tr valign="top">
     99        <th scope="row">Subscribe Text</th>
     100        <td><input type="text" name="ytSubscribe_subscribe_text" value="<?php echo esc_attr( get_option('ytSubscribe_subscribe_text',"Subscribe to My Coding Tricks") ); ?>" /></td>
     101        <td></td>
     102        </tr>
     103   
     104        <tr valign="top">
     105        <th scope="row">Custom CSS</th>
     106        <td><textarea name="ytSubscribe_customcss" style="min-height:150px"><?php echo esc_attr( get_option('ytSubscribe_customcss',".ytSubscribe-inner h3{padding:0px;float:left;color:#000;margin:9px 5px 0px 0px;line-height: 20px;font-size: 18px;}") ); ?></textarea></td>
     107        <td></td>
    94108        </tr>
    95109         
  • ytsubscribe/trunk/index.php

    r1406540 r1406772  
    44 * Plugin URI: http://mycodingtricks.com
    55 * Description: ytSubscribe is a Youtube Subscribe Button jQuery Plugin that automatically inserts Youtube Subscribe Button Below each Video in your WordPress Post.
    6  * Version: 2.0
     6 * Version: 2.1
    77 * Author: Shubham Kumar
    88 * Author URI: http://mycodingtricks.com
     
    1818);
    1919
     20function ytSubscribe_action_links($links){
     21    $mylinks = array(
     22        "<a href='".admin_url('admin.php?page=ytsubscribe/admin/index.php')."'>Settings</a>",
     23        "<a href='http://mycodingtricks.com/wordpress/ytsubscribe-wordpress-plugin/' target=_blank>Tutorial</a>"
     24    );
     25    return array_merge($links,$mylinks);
     26}
     27
     28
    2029//Don't Edit after this
    2130
     
    2332function load_ytSubscribe(){
    2433    wp_enqueue_script('ytSubscribe',plugins_url('ytSubscribe.js',__FILE__),array('jquery'),$ver);
     34}
     35function ytSubscribe_customcss(){
     36    echo "<style>".esc_attr( get_option('ytSubscribe_customcss',".ytSubscribe-inner h3{padding:0px;float:left;color:#000;margin:9px 5px 0px 0px;line-height: 20px;font-size: 18px;}") )."</style>";
    2537}
    2638function add_ytSubscribe($content){
     
    3446                  layout: '".$config['layout']."',
    3547                },
    36                 structure: \"<\"+\"h3 style='padding:0px;float:left;color:#000;margin:5px;line-height: 20px;font-size: 18px;'>Subscribe to My Coding Tricks\"+\"</\h3>\"+\"<\"+\"div class='ytSubscribe-btn'></\div>\"
     48                structure: \"<\"+\"h3>".esc_attr( get_option('ytSubscribe_subscribe_text',"Subscribe to My Coding Tricks") )."<\"+\"/\h3>\"+\"<\"+\"div class='ytSubscribe-btn'></\div>\"
    3749           });
    3850        })(jQuery);
     
    4052    return $content;
    4153}
     54add_action('wp_head','ytSubscribe_customcss');
    4255add_action('wp_enqueue_scripts','load_ytSubscribe');
    4356add_filter('the_content','add_ytSubscribe');
     57add_filter('plugin_action_links_'.plugin_basename(__FILE__),'ytSubscribe_action_links');
  • ytsubscribe/trunk/readme.txt

    r1406540 r1406772  
    55Requires at least: 3.1
    66Tested up to: 4.5
    7 Stable tag: 2.0
     7Stable tag: 2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1919== Screenshots ==
    20201. Working Demo.
     212. ytSubscribe Admin Panel
    2122
    2223== Frequently Asked Questions ==
  • ytsubscribe/trunk/ytSubscribe.js

    r1406486 r1406772  
    6969        }
    7070        function style(){
    71             $("head").append("<style>@media (max-width:480px){.ytSubscribe-inner>* {float:none;}}.ytSubscribe-iframe .ytSubscribe{background:#F9F9F9;}.ytSubscribe-iframe.grey .ytSubscribe h3 {color: #fff !important;}.ytSubscribe-iframe.grey .ytSubscribe{background: #202020;color: #fff !important;}.ytSubscribe-iframe.dark .ytSubscribe{background:black;color:#fff !important;}.ytSubscribe{position:absolute;height:40px;width:100%;text-align:center;}.ytSubscribe-iframe>iframe{border:0px;margin-bottom:0px!important;}.ytSubscribe-btn{display:inline-block;width:190px;}.ytSubscribe-inner>*{float:left;}</style>");
     71            $("head").append("<style>@media (max-width:480px){ytSubscribe-inner h3{margin:0px 5px 0px 5px;}.ytSubscribe-inner>* {float:none;}}.ytSubscribe-iframe .ytSubscribe{background:#F9F9F9;}.ytSubscribe-iframe.grey .ytSubscribe h3 {color: #fff !important;}.ytSubscribe-iframe.grey .ytSubscribe{background: #202020;color: #fff !important;}.ytSubscribe-iframe.dark .ytSubscribe{background:black;color:#fff !important;}.ytSubscribe{position:absolute;height:40px;width:100%;text-align:center;}.ytSubscribe-iframe>iframe{border:0px;margin-bottom:0px!important;}.ytSubscribe-btn{display:inline-block;width:190px;}.ytSubscribe-inner>*{float:left;}</style>");
    7272        }
    7373        function addYoutubeButton($iframe){
Note: See TracChangeset for help on using the changeset viewer.