Plugin Directory

Changeset 2593898


Ignore:
Timestamp:
09/05/2021 02:07:41 PM (5 years ago)
Author:
koroshabbasy
Message:

magic schema updated

Location:
magic-schema/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • magic-schema/trunk/MagicSchema.php

    r2329840 r2593898  
    22/*
    33Plugin Name: Magic schema 
    4 Plugin URI: https://packfeedback.com/
    54Description: Plugin for displaying FAQ asked questions in WordPress
    65Author: korosh abbasy
    76Version: 1
    8 Author URI: https://www.instagram.com/korosh_abbasy/   
    9 TextDomain:  Magic schema
     7Author URI: https://www.instagram.com/korosh_abbasy/
    108*/
    119require_once 'inc/init.php';
  • magic-schema/trunk/inc/data-plugin.php

    r2307956 r2593898  
    66    public function __construct(){
    77         add_action('plugins_loaded',array($this,'textdomain'));
    8      
     8         add_action( 'wp_enqueue_scripts',array($this,'MagicSchema_front_enqueue_scripts') );
    99    }   
    1010    public static function textdomain()
     
    1616        return plugins_url( MagicSchema_faq_path_folder.'/'.$url);
    1717    }
    18    
     18    public function MagicSchema_front_enqueue_scripts(){
     19     
     20            wp_enqueue_script('MagicSchema_FAQ_front_js',$this->MagicSchema_faq_plugins_url('assets/js/MagicSchema-faq-front.js'),array(),MagicSchema_faq_version,true);
     21            wp_enqueue_style('MagicSchema_FAQ_front_style',$this->MagicSchema_faq_plugins_url('assets/css/MagicSchema-faq-front-style.css'),array(),MagicSchema_faq_version,'all');
     22    }
    1923 
    2024}
  • magic-schema/trunk/inc/functions.php

    r2392501 r2593898  
    6262    echo $output;
    6363}
     64// shotrcode [MS-FAQ title='']
     65function MagicSchema_display($atts="title"){
     66 
     67        $a = shortcode_atts( array(
     68          'title' => 'Frequently Asked Questions'
     69       ), $atts );
     70        $output="";
     71     
     72        // Check if we're inside the main loop in a single post page.
     73        if (   in_the_loop() && is_main_query() ) {
     74             
     75            $mgicFAQ_base_meta =  get_post_meta(get_the_ID(),'MagicSchema_base_meta',TRUE);
     76            if ($mgicFAQ_base_meta) {
     77            $i=0;
     78            $count=count($mgicFAQ_base_meta);
     79
     80            $output.='   <div class="container-mg" id="container-mg"><div class="accordion-mg">';
     81            $output.='<h3>'.$a['title'].'</h3>';
     82                 foreach ($mgicFAQ_base_meta as $filds)
     83                 {
     84                     $output.='<div class="accordion-item">';
     85                     $output.='<h4>'.esc_attr($filds[0]).'</h4>';
     86                     $output.='<div class="content-mg"><p>'.esc_attr($filds[1]).'</p></div>';
     87                     $output.='</div>';
     88                 }
     89            $output.='</div></div>' ;
     90
     91            }
     92            // one display 
     93            MagicSchemaData::$display=false;
     94            return  $output ;
     95        }else{
     96            return ;
     97
     98        }
     99 
     100}
     101add_shortcode( 'MS-FAQ', 'MagicSchema_display' ,10 );
    64102function MagicSchema($content=""){
    65103 
    66104  $output="";
    67105    // Check if we're inside the main loop in a single post page.
    68     if ( is_single() && in_the_loop() && is_main_query() ) {
     106    if ( in_the_loop() && is_main_query() ) {
    69107         
    70108        $mgicFAQ_base_meta =  get_post_meta(get_the_ID(),'MagicSchema_base_meta',TRUE);
     
    84122     
    85123        // display in site (one display)
    86          
     124        if(MagicSchemaData::$display==true)
     125        {
     126
     127            $display_faq=do_shortcode("[MS-FAQ]" , 99);
     128 
     129            $output=$display_faq.$output;
     130        }
     131 
     132         
    87133        return   $content.$output ;
    88134    }else{
     
    94140}
    95141add_filter( 'the_content', 'MagicSchema' ,99 );
    96 // function magic_schema_notice(){
    97 //     global $pagenow;
    98 //     // if ( $pagenow == 'index.php' ) {
    99 //     $user = wp_get_current_user();
    100 //  $allowed_roles = array('editor', 'administrator', 'author');
    101 //     if (  array_intersect($allowed_roles, $user->roles ) ) {
    102 //     echo  "<div class='notice notice-info is-dismissible'>
    103 //           <div class='magic-schema-notice'>
    104 //            <h1> Magic Schema pro </h1>
    105 //              <ul>
    106 //                  <li>Except displaying schema in search engines  ، frequently Asked Questions on the Site
    107 //           shows (by accordion)</li>
    108 //                  <li>The display feature is released on the pages (Supports all post types)</li>
    109 //                  <li>Ddisplay by short code [MS-FAQ title='']  </li>
    110 //              </ul>
    111 //            <a target='_blank' href='https://www.instagram.com/packfeedback/' class='para-magic-schema-link'>go to <span>pro version </span> </a>
    112 //            <p> Send your message direct (instagram)  @packfeedback 
    113 //            <span class='Price-magic'>Price : <i>$13</i></span> </p>
    114142
    115 //           </div>
    116 //           </div>
    117 //           <style>
    118 
    119 //          .magic-schema-notice {
    120 //              direction: ltr;
    121 //          }.magic-schema-notice ul li {
    122 //              list-style: inside;
    123 //          }
    124 //          a.para-magic-schema-link {
    125 //              background: rgb(253,216,53);
    126 //              display: inline-block;
    127 //              width: auto;
    128 //              padding: 10px;
    129 //              color: #000;
    130 //              margin: 0;
    131 //              font-size: 1.3em;border-radius: 3px;    font-weight: bold;
    132 //          }a.para-magic-schema-link a {
    133 //              color: rgb(3,169,244);
    134 //          }span.Price-magic {
    135 //              border: 1px solid;
    136 //              padding: 6px;
    137 //              color: rgb(102,187,106);border-radius: 5px;
    138 //          }
    139 //           </style>";
    140 //     }
    141 // // }
    142 // }
    143 // add_action('admin_notices', 'magic_schema_notice');
    144143 
    145144?>
  • magic-schema/trunk/readme.txt

    r2329840 r2593898  
    1414== Description ==
    1515
    16 This plugin is for displaying schema on the website . It currently has questions and answers (schema FAQ)
    17 In the free version, the schema plugin does not work for pages
     16This plugin is for displaying schema FAQ on the website 
    18171- Install the plugin
    19182- A metabox is created
    20193- Create and save questions and answers
    21204- The question and answer schema is automatically displayed to Google
    22    
    23 pro version :
    24 
    25 In addition to the free version capabilities
    26 1- Except displaying schema in search engines  ، frequently Asked Questions on the Site
    27  shows (by accordion)
    28 2- The display feature is released on the pages
    29 3- Ddisplay by short code [MS-FAQ title=''] 
     215- Change location and title with short code [MS-FAQ title=''] 
    3022get pro : https://www.instagram.com/packfeedback/
    3123direct instagram
     
    3426= What to do after installation? =
    3527
    36 1-In the admin, go to the sections (free version (all post type - pages),pro(all post type + pages)) and find Metabox.
    37 2-Create and publish your own questions
    38 
    39 = What is possible from schema ? =
    40 
    41 It currently supports the ّ schema FAQ
     281- > wp-admin, go to the sections and find Metabox add MAgic Schema
     292-Create FAQ and publish 
    4230
    4331== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.