Changeset 2593898
- Timestamp:
- 09/05/2021 02:07:41 PM (5 years ago)
- Location:
- magic-schema/trunk
- Files:
-
- 7 edited
-
MagicSchema.php (modified) (1 diff)
-
inc/data-plugin.php (modified) (2 diffs)
-
inc/functions.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-3.png (modified) (previous)
-
screenshot-4.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
magic-schema/trunk/MagicSchema.php
r2329840 r2593898 2 2 /* 3 3 Plugin Name: Magic schema 4 Plugin URI: https://packfeedback.com/5 4 Description: Plugin for displaying FAQ asked questions in WordPress 6 5 Author: korosh abbasy 7 6 Version: 1 8 Author URI: https://www.instagram.com/korosh_abbasy/ 9 TextDomain: Magic schema 7 Author URI: https://www.instagram.com/korosh_abbasy/ 10 8 */ 11 9 require_once 'inc/init.php'; -
magic-schema/trunk/inc/data-plugin.php
r2307956 r2593898 6 6 public function __construct(){ 7 7 add_action('plugins_loaded',array($this,'textdomain')); 8 8 add_action( 'wp_enqueue_scripts',array($this,'MagicSchema_front_enqueue_scripts') ); 9 9 } 10 10 public static function textdomain() … … 16 16 return plugins_url( MagicSchema_faq_path_folder.'/'.$url); 17 17 } 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 } 19 23 20 24 } -
magic-schema/trunk/inc/functions.php
r2392501 r2593898 62 62 echo $output; 63 63 } 64 // shotrcode [MS-FAQ title=''] 65 function 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 } 101 add_shortcode( 'MS-FAQ', 'MagicSchema_display' ,10 ); 64 102 function MagicSchema($content=""){ 65 103 66 104 $output=""; 67 105 // 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() ) { 69 107 70 108 $mgicFAQ_base_meta = get_post_meta(get_the_ID(),'MagicSchema_base_meta',TRUE); … … 84 122 85 123 // 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 87 133 return $content.$output ; 88 134 }else{ … … 94 140 } 95 141 add_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 Site107 // 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) @packfeedback113 // <span class='Price-magic'>Price : <i>$13</i></span> </p>114 142 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');144 143 145 144 ?> -
magic-schema/trunk/readme.txt
r2329840 r2593898 14 14 == Description == 15 15 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 16 This plugin is for displaying schema FAQ on the website 18 17 1- Install the plugin 19 18 2- A metabox is created 20 19 3- Create and save questions and answers 21 20 4- 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=''] 21 5- Change location and title with short code [MS-FAQ title=''] 30 22 get pro : https://www.instagram.com/packfeedback/ 31 23 direct instagram … … 34 26 = What to do after installation? = 35 27 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 28 1- > wp-admin, go to the sections and find Metabox add MAgic Schema 29 2-Create FAQ and publish 42 30 43 31 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.