Changeset 2685427
- Timestamp:
- 02/26/2022 07:38:34 PM (3 years ago)
- Location:
- rockon-all-in-one
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
rockon-all-in-one/tags/3.0/inc/raio_comment_fun.php
r1604687 r2685427 1 1 <?php 2 function raio_disable_comments_post_types_support() 2 function raio_disable_comments_post_types_support(){ 3 3 $post_types = get_post_types(); 4 4 foreach ($post_types as $post_type) { 5 if(post_type_supports($post_type, 'comments')) 5 if(post_type_supports($post_type, 'comments')){ 6 6 remove_post_type_support($post_type, 'comments'); 7 7 remove_post_type_support($post_type, 'trackbacks'); … … 12 12 13 13 // Close comments on the front-end 14 function raio_disable_comments_status() 14 function raio_disable_comments_status(){ 15 15 return false; 16 16 } -
rockon-all-in-one/tags/3.0/inc/raio_function.php
r2041613 r2685427 1 1 <?php 2 3 function raio_loaded() { 2 function raio_loaded(){ 4 3 /** 5 4 * Fires upon plugins_loaded WordPress hook. … … 36 35 add_menu_page( __( 'Rockon All in One', 'rockon-all-in-one-ui' ), __( 'Rockon All in One', 'rockon-all-in-one-ui' ), $capability, $parent_slug, 'raio_dashboard', raio_menu_icon() ); 37 36 add_submenu_page( $parent_slug, __( 'Settings & Shortcode', 'rockon-all-in-one-ui' ), __( 'Settings & Shortcode', 'rockon-all-in-one-ui' ), $capability, 'raio_manage_setting', array($this, 'raio_manage_setting')); 37 //add_submenu_page( $parent_slug, __( 'Shortcode', 'rockon-all-in-one-ui' ), __( 'Shortcode', 'rockon-all-in-one-ui' ), $capability, 'raio_manage_shortcode', array($this, 'raio_manage_setting') ); 38 38 //add_submenu_page( $parent_slug, __( 'Help', 'rockon-all-in-one-ui' ), __( 'Help', 'rockon-all-in-one-ui' ), $capability, 'raio_help', 'raio_help' ); 39 39 … … 43 43 public function raio_manage_setting(){ 44 44 ?> 45 46 45 <div class="wrap"> 47 46 <div id="icon-themes" class="icon32"></div> 48 <h2> <?php esc_html_e('RockOn All in One', 'rockon-all-in-one');?></h2>47 <h2>RockOn All in One</h2> 49 48 <?php settings_errors(); ?> 50 49 <?php … … 53 52 $active_tab = $_GET[ 'tab' ]; 54 53 } 55 ?> 56 54 ?> 57 55 <h2 class="nav-tab-wrapper"> 58 56 <a href="?page=raio_manage_setting&tab=raio_setting" class="nav-tab <?php echo $active_tab == 'raio_setting' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Settings', 'rockon-all-in-one');?></a> … … 62 60 </h2> 63 61 64 <?php if($active_tab == 'raio_setting' ) { 65 66 $this->raio_manage_setting_section(); 67 68 } else if($active_tab == 'raio_breadcrumb_options' ) { 69 70 $this->raio_breadcrumbs_setting_section(); 71 72 } else if($active_tab == 'raio_hfscript_options' ) { 73 74 $this->raio_hf_script_section(); 75 76 } else { 77 62 <?php if($active_tab == 'raio_setting' ) { 63 $this->raio_manage_setting_section(); 64 } else if($active_tab == 'raio_breadcrumb_options' ) { 65 $this->raio_breadcrumbs_setting_section(); 66 } else if($active_tab == 'raio_hfscript_options' ) { 67 $this->raio_hf_script_section(); 68 } else { 78 69 $this->raio_tbshortcode_section(); 79 70 } … … 83 74 } 84 75 85 76 public function raio_manage_setting_section() 86 77 { 87 78 ?> … … 122 113 </div> 123 114 </div> 124 115 <?php 125 116 } 126 117 127 118 public function raio_breadcrumbs_setting_section() 128 119 { 129 120 ?> … … 165 156 <div class="raio-wrap"> 166 157 <form name="raiofollow" action="options.php" method="post"> 167 <?php settings_fields( 'raio_hfscript_options' ); ?> 158 <?php settings_fields( 'raio_hfscript_options' ); ?> 168 159 <h3 class="raio-labels" for="raio_insert_header"><?php esc_html_e('Scripts in header:', 'rockon-all-in-one');?> </h3> 169 160 <textarea rows="5" cols="57" id="raio_insert_header" name="raio_insert_header"><?php echo esc_html(get_option('raio_insert_header'));?></textarea> … … 220 211 public function raio_init() 221 212 { 222 register_setting( 223 register_setting( 224 register_setting( 225 register_setting( 226 register_setting( 213 register_setting('raio_hfscript_options', 'raio_insert_header', 'trim' ); 214 register_setting('raio_hfscript_options', 'raio_insert_footer', 'trim' ); 215 register_setting('raio_script_options', 'raio_act_hsf', 'trim' ); 216 register_setting('raio_script_options', 'raio_comment_dc', 'trim' ); 217 register_setting('raio_breadcrumb_options', 'raio_bdc_separator', 'trim' ); 227 218 } 228 219 } 229 220 230 if 221 if(is_admin()){ 231 222 $raio_settings_page = new Raio_Manager(); 232 223 } -
rockon-all-in-one/tags/3.0/inc/raio_setting.php
r1604687 r2685427 1 1 <?php 2 function raio_dashboard() 2 function raio_dashboard(){ 3 3 ?> 4 4 <div class="wrap raio-about-wrap about-wrap"> … … 36 36 <div class="changelog about-integrations"> 37 37 <div class="raio-feature feature-section col three-col"> 38 <div class="">38 <div> 39 39 <h2><?php esc_html_e('Breadcrumbs', 'rockon-all-in-one'); ?></h2> 40 40 <p><?php esc_html_e( 'Breadcrumbs option with shortcode', 'rockon-all-in-one' ); ?></p> 41 41 </div> 42 <div class="">42 <div> 43 43 <h2><?php esc_html_e( 'Content limit', 'rockon-all-in-one' ); ?></h2> 44 44 <p><?php esc_html_e( 'Extract content limit according need available with short-code', 'rockon-all-in-one' ); ?></p> 45 45 </div> 46 <div class="">46 <div> 47 47 <h2><?php esc_html_e( 'Disable/Enable Comments', 'rockon-all-in-one' ); ?></h2> 48 48 <p><?php esc_html_e( 'You are easily Disable or Enable Comments on everywhere with on check-box', 'rockon-all-in-one' ); ?></p> 49 49 </div> 50 <div class="">50 <div> 51 51 <h2><?php esc_html_e( 'Added Option add script header or footer', 'rockon-all-in-one' ); ?></h2> 52 52 <p><?php esc_html_e( 'You are easily add script on header & footer using RockOn Plugin', 'rockon-all-in-one'); ?></p> … … 57 57 </div> 58 58 </div> 59 </div> 60 59 </div> 61 60 <!--<div class="extranotes"> 62 61 <h1>More from RockOn VS Studios</h1> … … 79 78 </div> 80 79 </div>--> 81 82 83 80 </div> 84 81 <?php } ?> -
rockon-all-in-one/tags/3.0/readme.txt
r2432433 r2685427 3 3 Tags: rockon, head, footer, comment, breadcrumb, scripts, header, post, admin, enable, disable, vs, page, content, limit, shortcode 4 4 Requires at least: 3.6 5 Tested up to: 5. 65 Tested up to: 5.9 6 6 Stable tag: 3.0 7 7 License: GPLv2 or later -
rockon-all-in-one/tags/3.0/rockon-all-in-one.php
r2041613 r2685427 16 16 define('RAIO_WP_VERSION', get_bloginfo('version')); 17 17 18 function raio _load_textdomain() {18 function raioLoadTextDomain() { 19 19 load_plugin_textdomain( 'rockon-all-in-one' ); 20 20 } 21 add_action( 'plugins_loaded', 'raio _load_textdomain' );22 23 function raio _create_submenus() {21 add_action( 'plugins_loaded', 'raioLoadTextDomain' ); 22 23 function raioCreateSubmenus() { 24 24 require_once( RAIO_PATH . 'inc/raio_setting.php' ); 25 25 } 26 add_action( 'raio_loaded', 'raio _create_submenus' );26 add_action( 'raio_loaded', 'raioCreateSubmenus' ); 27 27 28 28 require_once( RAIO_PATH . 'inc/raio_function.php' ); 29 29 30 function raio_add_script_header() 31 { 30 function raioAddScriptHeader(){ 32 31 $meta = get_option( 'raio_insert_header', '' ); 33 if ( $meta != '' ) { 34 echo $meta, "\n"; 35 } 36 37 $raio_post_meta = get_post_meta( get_the_ID(), 'raio_insert_header' , TRUE ); 38 if ( $raio_post_meta != '' ) { 39 echo $raio_post_meta['raio_insert_header'], "\n"; 40 } 41 } 42 43 function raio_add_script_footer() 44 { 45 if ( !is_admin() && !is_feed() && !is_robots() && !is_trackback() ) { 46 $raiotext = get_option( 'raio_insert_footer', '' ); 47 $raiotext = convert_smilies( $raiotext ); 48 $raiotext = do_shortcode( $raiotext ); 32 if($meta != ''){ 33 echo $meta, "\n"; 34 } 35 36 $raio_post_meta = get_post_meta( get_the_ID(), 'raio_insert_header' , TRUE ); 37 if($raio_post_meta != ''){ 38 echo $raio_post_meta['raio_insert_header'], "\n"; 39 } 40 } 41 42 function raioAddScriptFooter(){ 43 if(!is_admin() && !is_feed() && !is_robots() && !is_trackback()){ 44 $raiotext = get_option( 'raio_insert_footer', '' ); 45 $raiotext = convert_smilies( $raiotext ); 46 $raiotext = do_shortcode( $raiotext ); 49 47 50 if ( $raiotext != '' ){48 if( $raiotext != '' ){ 51 49 echo $raiotext, "\n"; 52 50 } 53 } 54 } 55 56 /***********************Content-Limit*********************/ 57 58 function raio_content($raio_atts) { 51 } 52 } 53 54 /*** 55 *Content-Limit 56 ***/ 57 function raioContent($raio_atts){ 59 58 $raio_args = shortcode_atts( array( 60 59 'limit' => '500' 61 60 ), $raio_atts ); 62 61 63 62 $raio_limit = $raio_args['limit']; 64 63 65 64 $content = explode(' ', get_the_content(), $raio_limit); 66 65 67 66 if (count($content)>=$raio_limit) { … … 76 75 return $content; 77 76 } 78 add_shortcode( 'rockon_content', 'raio _content' ); // [rockon_content limit=25]77 add_shortcode( 'rockon_content', 'raioContent' ); // [rockon_content limit=25] 79 78 80 79 /** 81 80 * breadcrumbs Code 82 */ 83 84 function raio_breadcrumbs() 85 { 86 81 **/ 82 function raioBreadcrumbs(){ 87 83 $raio_divider = '>'; 88 84 $bdc_sep = get_option('raio_bdc_separator'); … … 92 88 } 93 89 94 $home 95 $before 96 $sep 97 $after 98 99 if (!is_home() && !is_front_page() || is_paged()){90 $home = __('Home', 'bootstrapwp'); // text for the 'Home' link 91 $before = '<li class="active">'; // tag before the current crumb 92 $sep = '<span class="divider">'.$raio_divider.'</span>'; 93 $after = '</li>'; // tag after the current crumb 94 95 if(!is_home() && !is_front_page() || is_paged()){ 100 96 101 97 global $post; 102 98 echo '<ul class="raio-breadcrumb breadcrumb">'; 103 99 104 100 $homeLink = home_url(); 105 101 106 107 108 if (is_category()){109 110 102 echo '<li><a href="'.$homeLink.'">'.$home.'</a> '.$sep.'</li>'; 103 104 if(is_category()){ 105 106 global $wp_query; 111 107 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 108 $cat_obj = $wp_query->get_queried_object(); 109 $thisCat = $cat_obj->term_id; 110 $thisCat = get_category($thisCat); 111 $parentCat = get_category($thisCat->parent); 112 if ($thisCat->parent != 0) { 113 echo get_category_parents($parentCat, true, $sep); 114 } 115 116 echo $before . __('Archive by category', 'bootstrapwp') . ' "' . single_cat_title('', false) . '"' . $after; 117 118 } elseif (is_day()) { 119 120 echo '<li><a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a></li> '; 121 echo '<li><a href="'.get_month_link(get_the_time('Y'), get_the_time('m')).'">'.get_the_time('F').'</a></li> '; 122 echo $before.get_the_time('d').$after; 123 124 } elseif (is_month()) { 125 126 echo '<li><a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a></li> '; 127 echo $before . get_the_time('F') . $after; 128 129 } elseif (is_year()) { 130 131 echo $before.get_the_time('Y').$after; 132 133 } elseif (is_single() && !is_attachment()) { 138 134 139 135 if (get_post_type() != 'post') { 140 136 141 $post_type = get_post_type_object(get_post_type()); 142 $slug = $post_type->rewrite; 143 echo '<li><a href="'.$homeLink.'/'.$slug['slug'].'/">'.$post_type->labels->singular_name.'</a></li> '; 144 echo $before . get_the_title() . $after; 145 146 } else { 147 148 $cat = get_the_category(); 149 $cat = $cat[0]; 150 echo '<li>'.get_category_parents($cat, true, $sep).'</li>'; 151 echo $before . get_the_title() . $after; 152 153 } 154 155 } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { 156 157 $post_type = get_post_type_object(get_post_type()); 158 echo $before.$post_type->labels->singular_name . $after; 159 160 } elseif (is_attachment()) { 161 162 $parent = get_post($post->post_parent); 163 $cat = get_the_category($parent->ID); 164 $cat = $cat[0]; 165 echo get_category_parents($cat, true, $sep); 166 echo '<li><a href="'.get_permalink($parent).'">'.$parent->post_title.'</a></li> '; 167 echo $before . get_the_title() . $after; 168 169 } elseif (is_page() && !$post->post_parent) { 170 171 echo $before.get_the_title().$after; 172 173 } elseif (is_page() && $post->post_parent) { 174 175 $parent_id = $post->post_parent; 176 $breadcrumbs = array(); 177 178 while ($parent_id) { 179 180 $page = get_page($parent_id); 181 $breadcrumbs[] = '<li><a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>'.$sep.'</li>'; 182 $parent_id = $page->post_parent; 183 184 } 185 186 $breadcrumbs = array_reverse($breadcrumbs); 187 188 foreach ($breadcrumbs as $crumb) { 189 190 echo $crumb; 191 192 } 193 194 echo $before.get_the_title().$after; 195 196 } elseif (is_search()) { 197 198 echo $before.__('Search results for', 'bootstrapwp').' "'.get_search_query().'"' . $after; 199 200 } elseif (is_tag()) { 201 202 echo $before.__('Posts tagged', 'bootstrapwp') . ' "'.single_tag_title('', false) . '"' . $after; 203 204 } elseif (is_author()) { 205 206 global $author; 207 208 $userdata = get_userdata($author); 209 210 echo $before.__('Articles posted by', 'bootstrapwp').' '.$userdata->display_name.$after; 211 212 } elseif (is_404()) { 213 echo $before . __('Error 404', 'bootstrapwp') . $after; 214 } 215 echo '</ul>'; 216 } 217 } 218 add_shortcode( 'rockon_breadcrumbs', 'raio_breadcrumbs' ); 219 220 function load_raio_wp_admin_style() { 221 wp_register_style( 'raio_wp_admin_css', RAIO_LINK.'assets/css/raio-admin-style.css', false, '3.0.0' ); 222 wp_enqueue_style( 'raio_wp_admin_css' ); 223 } 224 add_action( 'admin_enqueue_scripts', 'load_raio_wp_admin_style' ); 137 $post_type = get_post_type_object(get_post_type()); 138 $slug = $post_type->rewrite; 139 echo '<li><a href="'.$homeLink.'/'.$slug['slug'].'/">'.$post_type->labels->singular_name.'</a></li> '; 140 echo $before . get_the_title() . $after; 141 142 } else { 143 144 $cat = get_the_category(); 145 $cat = $cat[0]; 146 echo '<li>'.get_category_parents($cat, true, $sep).'</li>'; 147 echo $before . get_the_title() . $after; 148 149 } 150 151 } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()){ 152 153 $post_type = get_post_type_object(get_post_type()); 154 echo $before.$post_type->labels->singular_name . $after; 155 156 } elseif (is_attachment()) { 157 158 $parent = get_post($post->post_parent); 159 $cat = get_the_category($parent->ID); 160 $cat = $cat[0]; 161 echo get_category_parents($cat, true, $sep); 162 echo '<li><a href="'.get_permalink($parent).'">'.$parent->post_title.'</a></li> '; 163 echo $before . get_the_title() . $after; 164 165 } elseif (is_page() && !$post->post_parent) { 166 167 echo $before.get_the_title().$after; 168 169 } elseif (is_page() && $post->post_parent) { 170 171 $parent_id = $post->post_parent; 172 $breadcrumbs = array(); 173 174 while ($parent_id) { 175 $page = get_page($parent_id); 176 $breadcrumbs[] = '<li><a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>'.$sep.'</li>'; 177 $parent_id = $page->post_parent; 178 } 179 180 $breadcrumbs = array_reverse($breadcrumbs); 181 182 foreach ($breadcrumbs as $crumb) { 183 echo $crumb; 184 } 185 186 echo $before.get_the_title().$after; 187 188 } elseif (is_search()) { 189 190 echo $before.__('Search results for', 'bootstrapwp').' "'.get_search_query().'"' . $after; 191 192 } elseif (is_tag()) { 193 194 echo $before.__('Posts tagged', 'bootstrapwp') . ' "'.single_tag_title('', false) . '"' . $after; 195 196 } elseif (is_author()) { 197 198 global $author; 199 200 $userdata = get_userdata($author); 201 202 echo $before.__('Articles posted by', 'bootstrapwp').' '.$userdata->display_name.$after; 203 204 } elseif (is_404()) { 205 echo $before . __('Error 404', 'bootstrapwp') . $after; 206 } 207 echo '</ul>'; 208 } 209 } 210 add_shortcode( 'rockon_breadcrumbs', 'raioBreadcrumbs'); 211 212 function loadRaioWpAdminStyle() { 213 wp_register_style( 'raio_wp_admin_css', RAIO_LINK.'assets/css/raio-admin-style.css', false, '3.0.0' ); 214 wp_enqueue_style( 'raio_wp_admin_css' ); 215 } 216 add_action( 'admin_enqueue_scripts', 'loadRaioWpAdminStyle' ); 225 217 226 218 // Add RAIO Styles 227 function raio_register_styles() { 228 wp_register_style('raiostyle1', RAIO_LINK. 'assets/css/raio-style.css'); 229 wp_enqueue_style('raiostyle1'); 230 } 231 add_action('wp_print_styles', 'raio_register_styles'); 219 function raioRegisterStyles(){ 220 wp_register_style('raiostyle1', RAIO_LINK. 'assets/css/raio-style.css'); 221 //wp_register_style('raiostyle2', RAIO_LINK. 'assets/css/styles.css'); 222 wp_enqueue_style('raiostyle1'); 223 // wp_enqueue_style('raiostyle2'); 224 } 225 add_action('wp_print_styles', 'raioRegisterStyles'); 232 226 233 227 // Add RAIO Script 234 function raio_register_script() { 235 wp_register_script('raioscript1', RAIO_LINK. 'assets/js/raio_script.js'); 236 wp_enqueue_script('raioscript1'); 237 } 238 add_action('wp_print_scripts', 'raio_register_script'); 239 240 add_action( 'init', 'raio_init_allfun'); 241 function raio_init_allfun(){ 242 add_action('wp_head', 'raio_add_script_header'); 243 add_action('wp_footer', 'raio_add_script_footer'); 244 } 228 function raioRegisterScript() { 229 wp_register_script('raioscript1', RAIO_LINK. 'assets/js/raio_script.js'); 230 //wp_register_script('raioscript2', RAIO_LINK.'assets/js/script.js'); 231 wp_enqueue_script('raioscript1'); 232 // wp_enqueue_script('raioscript2'); 233 } 234 add_action('wp_print_scripts', 'raioRegisterScript'); 235 236 add_action( 'init', 'raioInitAllFunction'); 237 function raioInitAllFunction(){ 238 add_action('wp_head', 'raioAddScriptHeader'); 239 add_action('wp_footer', 'raioAddScriptFooter'); 240 } 245 241 246 242 /***comment-system***/ 247 248 249 250 243 $chk_cdsetting = get_option('raio_comment_dc'); 244 if (isset($chk_cdsetting) && $chk_cdsetting == 1) { 245 require_once(RAIO_PATH.'inc/raio_comment_fun.php'); 246 } 251 247 /***cs-end***/ 252 248 253 add_action( 'init', 'raio_script_hf'); 254 function raio_script_hf(){ 255 256 $chk_shf = get_option('raio_act_hsf'); 257 if (isset($chk_shf) && $chk_shf == 1) { 249 add_action( 'init', 'raioscriptHf'); 250 function raioScriptHf(){ 251 $chk_shf = get_option('raio_act_hsf'); 252 if(isset($chk_shf) && $chk_shf == 1){ 258 253 remove_action('wp_head', 'wp_print_scripts'); 259 254 remove_action('wp_head', 'wp_print_head_scripts', 9); -
rockon-all-in-one/trunk/inc/raio_comment_fun.php
r1604687 r2685427 1 1 <?php 2 function raio_disable_comments_post_types_support() 2 function raio_disable_comments_post_types_support(){ 3 3 $post_types = get_post_types(); 4 4 foreach ($post_types as $post_type) { 5 if(post_type_supports($post_type, 'comments')) 5 if(post_type_supports($post_type, 'comments')){ 6 6 remove_post_type_support($post_type, 'comments'); 7 7 remove_post_type_support($post_type, 'trackbacks'); … … 12 12 13 13 // Close comments on the front-end 14 function raio_disable_comments_status() 14 function raio_disable_comments_status(){ 15 15 return false; 16 16 } -
rockon-all-in-one/trunk/inc/raio_function.php
r1604687 r2685427 1 1 <?php 2 3 function raio_loaded() { 2 function raio_loaded(){ 4 3 /** 5 4 * Fires upon plugins_loaded WordPress hook. … … 44 43 public function raio_manage_setting(){ 45 44 ?> 46 47 45 <div class="wrap"> 48 46 <div id="icon-themes" class="icon32"></div> … … 54 52 $active_tab = $_GET[ 'tab' ]; 55 53 } 56 ?> 57 54 ?> 58 55 <h2 class="nav-tab-wrapper"> 59 56 <a href="?page=raio_manage_setting&tab=raio_setting" class="nav-tab <?php echo $active_tab == 'raio_setting' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Settings', 'rockon-all-in-one');?></a> … … 63 60 </h2> 64 61 65 <?php if($active_tab == 'raio_setting' ) { 66 67 $this->raio_manage_setting_section(); 68 69 } else if($active_tab == 'raio_breadcrumb_options' ) { 70 71 $this->raio_breadcrumbs_setting_section(); 72 73 } else if($active_tab == 'raio_hfscript_options' ) { 74 75 $this->raio_hf_script_section(); 76 77 } else { 78 62 <?php if($active_tab == 'raio_setting' ) { 63 $this->raio_manage_setting_section(); 64 } else if($active_tab == 'raio_breadcrumb_options' ) { 65 $this->raio_breadcrumbs_setting_section(); 66 } else if($active_tab == 'raio_hfscript_options' ) { 67 $this->raio_hf_script_section(); 68 } else { 79 69 $this->raio_tbshortcode_section(); 80 70 } … … 84 74 } 85 75 86 76 public function raio_manage_setting_section() 87 77 { 88 78 ?> … … 123 113 </div> 124 114 </div> 125 115 <?php 126 116 } 127 117 128 118 public function raio_breadcrumbs_setting_section() 129 119 { 130 120 ?> … … 166 156 <div class="raio-wrap"> 167 157 <form name="raiofollow" action="options.php" method="post"> 168 <?php settings_fields( 'raio_hfscript_options' ); ?> 158 <?php settings_fields( 'raio_hfscript_options' ); ?> 169 159 <h3 class="raio-labels" for="raio_insert_header"><?php esc_html_e('Scripts in header:', 'rockon-all-in-one');?> </h3> 170 160 <textarea rows="5" cols="57" id="raio_insert_header" name="raio_insert_header"><?php echo esc_html(get_option('raio_insert_header'));?></textarea> … … 221 211 public function raio_init() 222 212 { 223 register_setting( 224 register_setting( 225 register_setting( 226 register_setting( 227 register_setting( 213 register_setting('raio_hfscript_options', 'raio_insert_header', 'trim' ); 214 register_setting('raio_hfscript_options', 'raio_insert_footer', 'trim' ); 215 register_setting('raio_script_options', 'raio_act_hsf', 'trim' ); 216 register_setting('raio_script_options', 'raio_comment_dc', 'trim' ); 217 register_setting('raio_breadcrumb_options', 'raio_bdc_separator', 'trim' ); 228 218 } 229 219 } 230 220 231 if 221 if(is_admin()){ 232 222 $raio_settings_page = new Raio_Manager(); 233 223 } -
rockon-all-in-one/trunk/inc/raio_setting.php
r1604687 r2685427 1 1 <?php 2 function raio_dashboard() 2 function raio_dashboard(){ 3 3 ?> 4 4 <div class="wrap raio-about-wrap about-wrap"> … … 36 36 <div class="changelog about-integrations"> 37 37 <div class="raio-feature feature-section col three-col"> 38 <div class="">38 <div> 39 39 <h2><?php esc_html_e('Breadcrumbs', 'rockon-all-in-one'); ?></h2> 40 40 <p><?php esc_html_e( 'Breadcrumbs option with shortcode', 'rockon-all-in-one' ); ?></p> 41 41 </div> 42 <div class="">42 <div> 43 43 <h2><?php esc_html_e( 'Content limit', 'rockon-all-in-one' ); ?></h2> 44 44 <p><?php esc_html_e( 'Extract content limit according need available with short-code', 'rockon-all-in-one' ); ?></p> 45 45 </div> 46 <div class="">46 <div> 47 47 <h2><?php esc_html_e( 'Disable/Enable Comments', 'rockon-all-in-one' ); ?></h2> 48 48 <p><?php esc_html_e( 'You are easily Disable or Enable Comments on everywhere with on check-box', 'rockon-all-in-one' ); ?></p> 49 49 </div> 50 <div class="">50 <div> 51 51 <h2><?php esc_html_e( 'Added Option add script header or footer', 'rockon-all-in-one' ); ?></h2> 52 52 <p><?php esc_html_e( 'You are easily add script on header & footer using RockOn Plugin', 'rockon-all-in-one'); ?></p> … … 57 57 </div> 58 58 </div> 59 </div> 60 59 </div> 61 60 <!--<div class="extranotes"> 62 61 <h1>More from RockOn VS Studios</h1> … … 79 78 </div> 80 79 </div>--> 81 82 83 80 </div> 84 81 <?php } ?> -
rockon-all-in-one/trunk/readme.txt
r1830260 r2685427 3 3 Tags: rockon, head, footer, comment, breadcrumb, scripts, header, post, admin, enable, disable, vs, page, content, limit, shortcode 4 4 Requires at least: 3.6 5 Tested up to: 4.95 Tested up to: 5.9 6 6 Stable tag: 3.0 7 7 License: GPLv2 or later -
rockon-all-in-one/trunk/rockon-all-in-one.php
r1699767 r2685427 16 16 define('RAIO_WP_VERSION', get_bloginfo('version')); 17 17 18 function raio _load_textdomain() {18 function raioLoadTextDomain() { 19 19 load_plugin_textdomain( 'rockon-all-in-one' ); 20 20 } 21 add_action( 'plugins_loaded', 'raio _load_textdomain' );22 23 function raio _create_submenus() {21 add_action( 'plugins_loaded', 'raioLoadTextDomain' ); 22 23 function raioCreateSubmenus() { 24 24 require_once( RAIO_PATH . 'inc/raio_setting.php' ); 25 25 } 26 add_action( 'raio_loaded', 'raio _create_submenus' );26 add_action( 'raio_loaded', 'raioCreateSubmenus' ); 27 27 28 28 require_once( RAIO_PATH . 'inc/raio_function.php' ); 29 29 30 function raio_add_script_header() 31 { 30 function raioAddScriptHeader(){ 32 31 $meta = get_option( 'raio_insert_header', '' ); 33 if ( $meta != '' ) { 34 echo $meta, "\n"; 35 } 36 37 $raio_post_meta = get_post_meta( get_the_ID(), 'raio_insert_header' , TRUE ); 38 if ( $raio_post_meta != '' ) { 39 echo $raio_post_meta['raio_insert_header'], "\n"; 40 } 41 } 42 43 function raio_add_script_footer() 44 { 45 if ( !is_admin() && !is_feed() && !is_robots() && !is_trackback() ) { 46 $raiotext = get_option( 'raio_insert_footer', '' ); 47 $raiotext = convert_smilies( $raiotext ); 48 $raiotext = do_shortcode( $raiotext ); 32 if($meta != ''){ 33 echo $meta, "\n"; 34 } 35 36 $raio_post_meta = get_post_meta( get_the_ID(), 'raio_insert_header' , TRUE ); 37 if($raio_post_meta != ''){ 38 echo $raio_post_meta['raio_insert_header'], "\n"; 39 } 40 } 41 42 function raioAddScriptFooter(){ 43 if(!is_admin() && !is_feed() && !is_robots() && !is_trackback()){ 44 $raiotext = get_option( 'raio_insert_footer', '' ); 45 $raiotext = convert_smilies( $raiotext ); 46 $raiotext = do_shortcode( $raiotext ); 49 47 50 if ( $raiotext != '' ){48 if( $raiotext != '' ){ 51 49 echo $raiotext, "\n"; 52 50 } 53 } 54 } 55 56 /***********************Content-Limit*********************/ 57 58 function raio_content($raio_atts) { 51 } 52 } 53 54 /*** 55 *Content-Limit 56 ***/ 57 function raioContent($raio_atts){ 59 58 $raio_args = shortcode_atts( array( 60 59 'limit' => '500' 61 60 ), $raio_atts ); 62 61 63 62 $raio_limit = $raio_args['limit']; 64 63 65 64 $content = explode(' ', get_the_content(), $raio_limit); 66 65 67 66 if (count($content)>=$raio_limit) { … … 76 75 return $content; 77 76 } 78 add_shortcode( 'rockon_content', 'raio _content' ); // [rockon_content limit=25]77 add_shortcode( 'rockon_content', 'raioContent' ); // [rockon_content limit=25] 79 78 80 79 /** 81 80 * breadcrumbs Code 82 */ 83 84 function raio_breadcrumbs() 85 { 86 81 **/ 82 function raioBreadcrumbs(){ 87 83 $raio_divider = '>'; 88 84 $bdc_sep = get_option('raio_bdc_separator'); … … 92 88 } 93 89 94 $home 95 $before 96 $sep 97 $after 98 99 if (!is_home() && !is_front_page() || is_paged()){90 $home = __('Home', 'bootstrapwp'); // text for the 'Home' link 91 $before = '<li class="active">'; // tag before the current crumb 92 $sep = '<span class="divider">'.$raio_divider.'</span>'; 93 $after = '</li>'; // tag after the current crumb 94 95 if(!is_home() && !is_front_page() || is_paged()){ 100 96 101 97 global $post; 102 98 echo '<ul class="raio-breadcrumb breadcrumb">'; 103 99 104 100 $homeLink = home_url(); 105 101 106 107 108 if (is_category()){109 110 102 echo '<li><a href="'.$homeLink.'">'.$home.'</a> '.$sep.'</li>'; 103 104 if(is_category()){ 105 106 global $wp_query; 111 107 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 108 $cat_obj = $wp_query->get_queried_object(); 109 $thisCat = $cat_obj->term_id; 110 $thisCat = get_category($thisCat); 111 $parentCat = get_category($thisCat->parent); 112 if ($thisCat->parent != 0) { 113 echo get_category_parents($parentCat, true, $sep); 114 } 115 116 echo $before . __('Archive by category', 'bootstrapwp') . ' "' . single_cat_title('', false) . '"' . $after; 117 118 } elseif (is_day()) { 119 120 echo '<li><a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a></li> '; 121 echo '<li><a href="'.get_month_link(get_the_time('Y'), get_the_time('m')).'">'.get_the_time('F').'</a></li> '; 122 echo $before.get_the_time('d').$after; 123 124 } elseif (is_month()) { 125 126 echo '<li><a href="'.get_year_link(get_the_time('Y')).'">'.get_the_time('Y').'</a></li> '; 127 echo $before . get_the_time('F') . $after; 128 129 } elseif (is_year()) { 130 131 echo $before.get_the_time('Y').$after; 132 133 } elseif (is_single() && !is_attachment()) { 138 134 139 135 if (get_post_type() != 'post') { 140 136 141 $post_type = get_post_type_object(get_post_type()); 142 $slug = $post_type->rewrite; 143 echo '<li><a href="'.$homeLink.'/'.$slug['slug'].'/">'.$post_type->labels->singular_name.'</a></li> '; 144 echo $before . get_the_title() . $after; 145 146 } else { 147 148 $cat = get_the_category(); 149 $cat = $cat[0]; 150 echo '<li>'.get_category_parents($cat, true, $sep).'</li>'; 151 echo $before . get_the_title() . $after; 152 153 } 154 155 } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { 156 157 $post_type = get_post_type_object(get_post_type()); 158 echo $before.$post_type->labels->singular_name . $after; 159 160 } elseif (is_attachment()) { 161 162 $parent = get_post($post->post_parent); 163 $cat = get_the_category($parent->ID); 164 $cat = $cat[0]; 165 echo get_category_parents($cat, true, $sep); 166 echo '<li><a href="'.get_permalink($parent).'">'.$parent->post_title.'</a></li> '; 167 echo $before . get_the_title() . $after; 168 169 } elseif (is_page() && !$post->post_parent) { 170 171 echo $before.get_the_title().$after; 172 173 } elseif (is_page() && $post->post_parent) { 174 175 $parent_id = $post->post_parent; 176 $breadcrumbs = array(); 177 178 while ($parent_id) { 179 180 $page = get_page($parent_id); 181 $breadcrumbs[] = '<li><a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>'.$sep.'</li>'; 182 $parent_id = $page->post_parent; 183 184 } 185 186 $breadcrumbs = array_reverse($breadcrumbs); 187 188 foreach ($breadcrumbs as $crumb) { 189 190 echo $crumb; 191 192 } 193 194 echo $before.get_the_title().$after; 195 196 } elseif (is_search()) { 197 198 echo $before.__('Search results for', 'bootstrapwp').' "'.get_search_query().'"' . $after; 199 200 } elseif (is_tag()) { 201 202 echo $before.__('Posts tagged', 'bootstrapwp') . ' "'.single_tag_title('', false) . '"' . $after; 203 204 } elseif (is_author()) { 205 206 global $author; 207 208 $userdata = get_userdata($author); 209 210 echo $before.__('Articles posted by', 'bootstrapwp').' '.$userdata->display_name.$after; 211 212 } elseif (is_404()) { 213 echo $before . __('Error 404', 'bootstrapwp') . $after; 214 } 215 echo '</ul>'; 216 } 217 } 218 add_shortcode( 'rockon_breadcrumbs', 'raio_breadcrumbs' ); 219 220 function load_raio_wp_admin_style() { 221 wp_register_style( 'raio_wp_admin_css', RAIO_LINK.'assets/css/raio-admin-style.css', false, '3.0.0' ); 222 wp_enqueue_style( 'raio_wp_admin_css' ); 223 } 224 add_action( 'admin_enqueue_scripts', 'load_raio_wp_admin_style' ); 137 $post_type = get_post_type_object(get_post_type()); 138 $slug = $post_type->rewrite; 139 echo '<li><a href="'.$homeLink.'/'.$slug['slug'].'/">'.$post_type->labels->singular_name.'</a></li> '; 140 echo $before . get_the_title() . $after; 141 142 } else { 143 144 $cat = get_the_category(); 145 $cat = $cat[0]; 146 echo '<li>'.get_category_parents($cat, true, $sep).'</li>'; 147 echo $before . get_the_title() . $after; 148 149 } 150 151 } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()){ 152 153 $post_type = get_post_type_object(get_post_type()); 154 echo $before.$post_type->labels->singular_name . $after; 155 156 } elseif (is_attachment()) { 157 158 $parent = get_post($post->post_parent); 159 $cat = get_the_category($parent->ID); 160 $cat = $cat[0]; 161 echo get_category_parents($cat, true, $sep); 162 echo '<li><a href="'.get_permalink($parent).'">'.$parent->post_title.'</a></li> '; 163 echo $before . get_the_title() . $after; 164 165 } elseif (is_page() && !$post->post_parent) { 166 167 echo $before.get_the_title().$after; 168 169 } elseif (is_page() && $post->post_parent) { 170 171 $parent_id = $post->post_parent; 172 $breadcrumbs = array(); 173 174 while ($parent_id) { 175 $page = get_page($parent_id); 176 $breadcrumbs[] = '<li><a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>'.$sep.'</li>'; 177 $parent_id = $page->post_parent; 178 } 179 180 $breadcrumbs = array_reverse($breadcrumbs); 181 182 foreach ($breadcrumbs as $crumb) { 183 echo $crumb; 184 } 185 186 echo $before.get_the_title().$after; 187 188 } elseif (is_search()) { 189 190 echo $before.__('Search results for', 'bootstrapwp').' "'.get_search_query().'"' . $after; 191 192 } elseif (is_tag()) { 193 194 echo $before.__('Posts tagged', 'bootstrapwp') . ' "'.single_tag_title('', false) . '"' . $after; 195 196 } elseif (is_author()) { 197 198 global $author; 199 200 $userdata = get_userdata($author); 201 202 echo $before.__('Articles posted by', 'bootstrapwp').' '.$userdata->display_name.$after; 203 204 } elseif (is_404()) { 205 echo $before . __('Error 404', 'bootstrapwp') . $after; 206 } 207 echo '</ul>'; 208 } 209 } 210 add_shortcode( 'rockon_breadcrumbs', 'raioBreadcrumbs'); 211 212 function loadRaioWpAdminStyle() { 213 wp_register_style( 'raio_wp_admin_css', RAIO_LINK.'assets/css/raio-admin-style.css', false, '3.0.0' ); 214 wp_enqueue_style( 'raio_wp_admin_css' ); 215 } 216 add_action( 'admin_enqueue_scripts', 'loadRaioWpAdminStyle' ); 225 217 226 218 // Add RAIO Styles 227 function raio_register_styles(){228 229 230 231 232 233 add_action('wp_print_styles', 'raio_register_styles');219 function raioRegisterStyles(){ 220 wp_register_style('raiostyle1', RAIO_LINK. 'assets/css/raio-style.css'); 221 //wp_register_style('raiostyle2', RAIO_LINK. 'assets/css/styles.css'); 222 wp_enqueue_style('raiostyle1'); 223 // wp_enqueue_style('raiostyle2'); 224 } 225 add_action('wp_print_styles', 'raioRegisterStyles'); 234 226 235 227 // Add RAIO Script 236 function raio_register_script() {237 238 239 240 241 242 add_action('wp_print_scripts', 'raio _register_script');228 function raioRegisterScript() { 229 wp_register_script('raioscript1', RAIO_LINK. 'assets/js/raio_script.js'); 230 //wp_register_script('raioscript2', RAIO_LINK.'assets/js/script.js'); 231 wp_enqueue_script('raioscript1'); 232 // wp_enqueue_script('raioscript2'); 233 } 234 add_action('wp_print_scripts', 'raioRegisterScript'); 243 235 244 245 add_action( 'init', 'raio_init_allfun'); 246 function raio_init_allfun(){ 247 248 add_action('wp_head', 'raio_add_script_header'); 249 add_action('wp_footer', 'raio_add_script_footer'); 250 251 } 236 add_action( 'init', 'raioInitAllFunction'); 237 function raioInitAllFunction(){ 238 add_action('wp_head', 'raioAddScriptHeader'); 239 add_action('wp_footer', 'raioAddScriptFooter'); 240 } 252 241 253 242 /***comment-system***/ 254 255 256 257 243 $chk_cdsetting = get_option('raio_comment_dc'); 244 if (isset($chk_cdsetting) && $chk_cdsetting == 1) { 245 require_once(RAIO_PATH.'inc/raio_comment_fun.php'); 246 } 258 247 /***cs-end***/ 259 248 260 add_action( 'init', 'raio_script_hf'); 261 function raio_script_hf(){ 262 263 $chk_shf = get_option('raio_act_hsf'); 264 if (isset($chk_shf) && $chk_shf == 1) { 249 add_action( 'init', 'raioscriptHf'); 250 function raioScriptHf(){ 251 $chk_shf = get_option('raio_act_hsf'); 252 if(isset($chk_shf) && $chk_shf == 1){ 265 253 remove_action('wp_head', 'wp_print_scripts'); 266 254 remove_action('wp_head', 'wp_print_head_scripts', 9);
Note: See TracChangeset
for help on using the changeset viewer.