WordPress.org

Plugin Directory

Changeset 1770926


Ignore:
Timestamp:
11/19/17 19:17:15 (4 weeks ago)
Author:
Litonice13
Message:

Fixed Notice ignore issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-awesome-faq/trunk/index.php

    r1681069 r1770926  
    44Plugin URI: https://jeweltheme.com/product/wordpress-faq-plugin/ 
    55Description: Accordion based Awesome WordPress FAQ Plugin 
    6 Version: 4.0.6 
     6Version: 4.0.7 
    77Author: Liton Arefin 
    88Author URI: https://jeweltheme.com 
    99License: GPL2 
    10 http://www.gnu.org/licenses/gpl-2.0.html 
     10https://www.gnu.org/licenses/gpl-2.0.html 
    1111*/ 
    1212 
     
    1717define('WP_AWESOME_FAQ_PRO_URL', 'https://jeweltheme.com/product/wordpress-faq-plugin/'); 
    1818 
    19 //Custom FAQ Post Type  
     19//Custom FAQ Post Type 
    2020function jeweltheme_wp_awesome_faq_post_type() { 
    2121    $labels = array( 
     
    3030        'search_items'       => __( 'Search FAQ' ), 
    3131        'not_found'          => __( 'No FAQ Items found' ), 
    32         'not_found_in_trash' => __( 'No FAQ Items found in the Trash' ),  
     32        'not_found_in_trash' => __( 'No FAQ Items found in the Trash' ), 
    3333        'parent_item_colon'  => '', 
    3434        'menu_name'          => 'FAQ' 
     
    5050    ); 
    5151 
    52     register_post_type( 'faq', $args );  
     52    register_post_type( 'faq', $args ); 
    5353 
    5454        // Add new taxonomy, make it hierarchical (like categories) 
     
    6666            'menu_name'         => __( 'FAQ Category' ), 
    6767        ); 
    68      
     68 
    6969        register_taxonomy('faq_cat',array('faq'), array( 
    7070            'hierarchical' => true, 
     
    8484        wp_enqueue_style('dashicons'); 
    8585        wp_enqueue_script('jquery-ui-accordion'); 
    86     }    
     86    } 
    8787} 
    8888add_action( 'init', 'jeweltheme_wp_awesome_faq_enqueue_scripts' ); 
     
    9393?> 
    9494<script type="text/javascript"> 
    95 <?php $faq_layout = get_option('jeweltheme_faq_collapse');  
     95<?php $faq_layout = get_option('jeweltheme_faq_collapse'); 
    9696 
    9797//print_r($faq_layout['layout']); 
     
    117117    }); 
    118118<?php } ?> 
    119      
     119 
    120120</script> 
    121121<?php 
     
    124124 
    125125 
    126 function jeweltheme_wp_awesome_faq_shortcode($atts, $content= null) {  
    127      
     126function jeweltheme_wp_awesome_faq_shortcode($atts, $content= null) { 
     127 
    128128    extract( shortcode_atts( 
    129129        array( 
     
    167167    global $faq; 
    168168 
    169     $count = 0;  
     169    $count = 0; 
    170170    $accordion = 'accordion-' . time() . rand(); 
    171171 
     
    178178                <?php if($image) echo "<img src='" . $image ."'>"; ?> 
    179179                    <?php the_content();?> 
    180                 </div>     
     180                </div> 
    181181 
    182182                <?php } //end while 
     
    203203    global $current_user ; 
    204204        $user_id = $current_user->ID; 
    205     if ( get_user_meta($user_id, 'jeweltheme_ignore_notice') ) { 
    206         echo '<div class="updated"><p>';          
     205    if ( ! get_user_meta($user_id, 'jeweltheme_ignore_notice') ) { 
     206        echo '<div class="updated"><p>'; 
    207207        printf(__('<h2 style="font-size: 20px; color: #5FA52A; font-weight: normal; margin-bottom: 10px; margin-top: 5px;"> 
    208208                    <a href="https://goo.gl/kX2nGF" target="_blank">#1 Video WordPress Theme on Market, now only $49 !!!</a></h2> 
    209209                    <h4 style="font-size: 20px; color: #5FA52A; font-weight: normal; margin-bottom: 10px; margin-top: 5px;"> 
    210                     <a href="http://jeweltheme.com/product/wp-awesome-faq-pro/" target="_blank">Get WP Awesome FAQ PRO Today!</a></h4> 
    211                     Check out Premium Features of <a href="http://jeweltheme.com/product/wp-awesome-faq-pro/" target="_blank">WP Awesome FAQ</a> Plugin. Compare Why this Plugin is really awesome !!! <br> 
     210                    <a href="https://jeweltheme.com/product/wp-awesome-faq-pro/" target="_blank">Get WP Awesome FAQ PRO Today!</a></h4> 
     211                    Check out Premium Features of <a href="https://jeweltheme.com/product/wp-awesome-faq-pro/" target="_blank">WP Awesome FAQ</a> Plugin. Compare Why this Plugin is really awesome !!! <br> 
    212212            Jewel Theme, always express the power of WordPress. We are one of the best Team for creating stunning WordPress Themes - Plugins and Website Templates. <br> 
    213             Check all of our <a href="http://jeweltheme.com/product-category/wordpress-themes/" target="_blank">Free and Premium WordPress Themes</a> and <a href="http://jeweltheme.com/product-category/wordpress-plugins/" target="_blank">WordPress Plugins </a> <a style="float: right;" href="%1$s">X</a>'), '?jeweltheme_ignore=0'); 
     213            Check all of our <a href="https://jeweltheme.com/product-category/wordpress-themes/" target="_blank">Free and Premium WordPress Themes</a> and <a href="https://jeweltheme.com/product-category/wordpress-plugins/" target="_blank">WordPress Plugins </a> <a style="float: right;" href="%1$s">X</a>'), '?jeweltheme_ignore=0'); 
    214214        echo "</p></div>"; 
    215215    } 
    216216} 
    217 add_action('admin_init', 'jeweltheme_wp_awesome_faq_ignore'); 
    218  
    219  
    220 function jeweltheme_wp_awesome_faq_ignore() { 
     217add_action('admin_init', 'jeweltheme_ignore'); 
     218 
     219 
     220function jeweltheme_ignore() { 
    221221    global $current_user; 
    222222        $user_id = $current_user->ID; 
     
    229229// Add settings link on plugin page 
    230230function wp_awesome_faq_plugin_action_links($links) { 
    231      
     231 
    232232    if(!defined('WP_FAQ_PREMIUM')){ 
    233233         $links[] = '<a href="'.WP_AWESOME_FAQ_PRO_URL.'" style="color:#fff; padding:3px 10px; background: red;" target="_blank">'._x('Upgrade', 'Plugin action link label.', 'jeweltheme').'</a>'; 
    234234    } 
    235235 
    236     $settings_link = '<a href="edit.php?post_type=faq&page=faq_options">Settings</a>';  
    237     array_unshift($links, $settings_link);  
    238      
     236    $settings_link = '<a href="edit.php?post_type=faq&page=faq_options">Settings</a>'; 
     237    array_unshift($links, $settings_link); 
     238 
    239239    return $links; 
    240240} 
     
    243243// Manage Category Shortcode Columns 
    244244add_filter("manage_faq_cat_custom_column", 'jeweltheme_wp_awesome_faq_cat_columns', 10, 3); 
    245 add_filter("manage_edit-faq_cat_columns", 'jeweltheme_wp_awesome_faq_cat_manage_columns');  
    246   
     245add_filter("manage_edit-faq_cat_columns", 'jeweltheme_wp_awesome_faq_cat_manage_columns'); 
     246 
    247247function jeweltheme_wp_awesome_faq_cat_manage_columns($theme_columns) { 
    248248    $new_columns = array( 
     
    261261    $theme = get_term($theme_id, 'faq_cat'); 
    262262    switch ($column_name) { 
    263          
     263 
    264264        case 'title': 
    265265            echo get_the_title(); 
    266266        break; 
    267267 
    268         case 'faq_category_shortcode':              
     268        case 'faq_category_shortcode': 
    269269             echo '[faq cat_id="' . $theme_id. '"]'; 
    270270        break; 
    271   
     271 
    272272        default: 
    273273            break; 
    274274    } 
    275     return $out;     
     275    return $out; 
    276276} 
    277277 
     
    285285function jeweltheme_wp_awesome_faq_tinymce_button() { 
    286286    global $typenow; 
    287      
     287 
    288288    // check user permissions 
    289289    if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { 
    290290    return; 
    291291    } 
    292      
     292 
    293293    // verify the post type 
    294294    if( ! in_array( $typenow, array( 'post', 'page' ) ) ) 
     
    303303 
    304304function jeweltheme_wp_awesome_faq_tinymce_plugin($plugin_array) { 
    305     $plugin_array['jeweltheme_faq_button'] = plugins_url( '/editor-button.js', __FILE__ );  
     305    $plugin_array['jeweltheme_faq_button'] = plugins_url( '/editor-button.js', __FILE__ ); 
    306306    return $plugin_array; 
    307307} 
     
    332332add_action('admin_init', 'jeweltheme_wp_awesome_faq_settings_store'); 
    333333 
    334 //Add options page  
     334//Add options page 
    335335function jeweltheme_wp_awesome_faq_options() { 
    336336    add_submenu_page( 'edit.php?post_type=faq', esc_html__('WP Awesome FAQ Admin Options', 'jeweltheme'), esc_html__('FAQ Settings', 'jeweltheme'), 'edit_posts', 'faq_options', 'jeweltheme_wp_awesome_faq_setting_functions'); 
     
    341341//Register Settings Page 
    342342function jeweltheme_wp_awesome_faq_settings_store() { 
    343     register_setting('jeweltheme_faq_settings', 'jeweltheme_faq_collapse');    
     343    register_setting('jeweltheme_faq_settings', 'jeweltheme_faq_collapse'); 
    344344} 
    345345 
     
    369369            <div class="icon32" id="icon-options-general"><br></div> 
    370370                <p><?php echo esc_html__('Settings sections for WP Awesome FAQ Options', 'jeweltheme');?></p> 
    371                  
     371 
    372372                <form action="options.php" method="post" enctype="multipart/form-data"> 
    373373 
    374374                    <?php settings_fields('jeweltheme_faq_settings'); ?> 
    375375 
    376                     <table class="form-table">        
     376                    <table class="form-table"> 
    377377                        <tr> 
    378378                            <th> 
     
    380380                            </th> 
    381381                            <td> 
    382                                 <?php  
     382                                <?php 
    383383                                    $options = get_option('jeweltheme_faq_collapse'); 
    384384                                    $items = array("Close All", "Open All","1st Item Open"); 
     
    411411// Is the premium features there ? 
    412412if(file_exists(WP_AWESOME_FAQ_DIR.'/premium.php')){ 
    413      
     413 
    414414    // Include the file 
    415415    include_once(WP_AWESOME_FAQ_DIR.'/premium.php'); 
    416      
     416 
    417417    wp_awesome_faq_init(); 
    418      
     418 
    419419} 
    420420 
     
    435435</style> 
    436436<?php 
    437      
    438     echo '<div style="margin: 10px 20px 0 2px;">     
     437 
     438    echo '<div style="margin: 10px 20px 0 2px;"> 
    439439            <div class="metabox-holder columns-2"> 
    440                 <div class="postbox-container">  
     440                <div class="postbox-container"> 
    441441                <div id="top-sortables" class="meta-box-sortables ui-sortable"> 
    442                      
     442 
    443443                    <table cellpadding="2" cellspacing="1" width="100%" class="fixed" border="0"> 
    444444                        <tr> 
     
    447447                    </table> 
    448448                    <hr /> 
    449                      
     449 
    450450                    <!--Main Table--> 
    451451                    <table cellpadding="8" cellspacing="1" width="100%" class="fixed"> 
     
    456456// The WP_AWESOME_FAQ Theme footer 
    457457function wp_awesome_faq_page_footer(){ 
    458      
     458 
    459459    echo '</td> 
    460460    <td width="200" valign="top" id="wp-awesome-right-bar">'; 
    461      
     461 
    462462    if(!defined('WP_FAQ_PREMIUM')){ 
    463          
     463 
    464464        echo ' 
    465465        <div class="postbox" style="min-width:0px !important;"> 
     
    482482            </div> 
    483483        </div>'; 
    484          
     484 
    485485    }else{ 
    486      
     486 
    487487        echo ' 
    488488        <div class="postbox" style="min-width:0px !important;"> 
     
    502502        </div>'; 
    503503    } 
    504      
     504 
    505505    echo '</td> 
    506506    </tr> 
     
    509509    <div style="width:45%;background:#FFF;padding:15px; margin:auto"> 
    510510        <b>Let your friends know that you have "WP Awesome FAQ" Looks on your website :</b> 
    511         <form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);"> 
     511        <form method="get" action="https://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);"> 
    512512            <textarea name="text" cols="45" row="3" style="resize:none;">I just Installed "WP Awesome FAQ" on my @WordPress site and my "Frequently Asked Questions" are looking Great. Thanks @jwthemeltd</textarea> 
    513513            &nbsp; &nbsp; <input type="submit" value="Tweet!" class="button button-primary" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/> 
    514514        </form> 
    515          
     515 
    516516    </div> 
    517517    <br /> 
    518      
     518 
    519519    <script> 
    520520    function dotweet(ele){ 
     
    523523    } 
    524524    </script> 
    525      
     525 
    526526    <hr /> 
    527527    <a href="https://jeweltheme.com/product/wordpress-faq-plugin" target="_blank">WP Awesome FAQ</a> v'.WP_AWESOME_FAQ_VERSION.'. You can report any bugs <a href="https://wordpress.org/plugins/wp-awesome-faq/" target="_blank">here</a>. 
    528528 
    529 </div>   
     529</div> 
    530530</div> 
    531531</div> 
Note: See TracChangeset for help on using the changeset viewer.