Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Removed functions after wp_head and wp_footer and added in hook with …
Browse files Browse the repository at this point in the history
…999 priority

On theme activation, favicon will be disable by default.
  • Loading branch information
manishsongirkar committed Jan 2, 2014
1 parent e420099 commit 7061920
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 75 deletions.
61 changes: 2 additions & 59 deletions admin/lib/rtp-admin-functions.php
Expand Up @@ -556,7 +556,7 @@ function rtp_theme_setup_values() {
'logo_width' => 224,
'logo_height' => 51,
'login_head' => '0',
'favicon_use' => 'image',
'favicon_use' => 'disable',
'favicon_upload' => RTP_IMG_FOLDER_URL . '/favicon.ico',
'favicon_id' => 0,
'footer_sidebar' => '0',
Expand Down Expand Up @@ -1287,61 +1287,4 @@ function rtp_mce_before_init($settings) {
function rtp_create_favicon($sizes) {
$sizes['favicon'] = array( 'width' => 16, 'height' => 16, 'crop' => 1);
return $sizes;
}

/**
* Displays a message for child theme users regarding change in header.php
*
* @since rtPanel 3.2
*/
function rtpanel_upgrade_32_notice() {
if (is_child_theme() && !get_site_option( 'rtp_upgrade_32' )) {
?>
<div class="updated rtp_upgrade_32_notice">
<p><?php _e( '<strong>Note:</strong> If you have overriden the header.php in your child theme make sure you place <strong>rtp_head();</strong> on the line just after <strong>wp_head();</strong>. This hook is being used to output your custom css.', 'rtPanel' ); ?><a class="alignright rtp_upgrade_32" href="#">X</a></p>
</div><?php
}
}

add_action( 'admin_notices', 'rtpanel_upgrade_32_notice' );

/**
* Handles ajax call to remove the rtp_upgrade_32_notice
*
* @since rtPanel 3.2
*/
function rtp_remove_upgrade_32_notice() {
if (is_child_theme()) {
update_site_option( 'rtp_upgrade_32', true);
}
die();
}

add_action( 'wp_ajax_remove_upgrade_32_notice', 'rtp_remove_upgrade_32_notice' );

/**
* Outputs neccessary script to remove rtp_upgrade_32_notice
*
* @since rtPanel 3.2
*/
function rtp_upgrade_32_notice_js() {
if (is_child_theme() && !get_site_option( 'rtp_upgrade_32' )) {
?>
<script type="text/javascript" >
jQuery(function(){
jQuery( '.rtp_upgrade_32' ).css( 'color', '#CC0000' );
jQuery( '.rtp_upgrade_32' ).click(function(e){
e.preventDefault();
jQuery( '.rtp_upgrade_32_notice' ).hide();
// call ajax
jQuery.ajax({
url:"<?php echo admin_url( 'admin-ajax.php' ); ?>",
type:'POST',
data:'action=remove_upgrade_32_notice'
});
});
});
</script><?php
}
}
add_action( 'admin_head', 'rtp_upgrade_32_notice_js' );
}
2 changes: 1 addition & 1 deletion assets/rtpanel/style.scss
Expand Up @@ -2,7 +2,7 @@
Theme Name: rtPanel
Theme URI: http://rtcamp.com/rtpanel/
Description: WordPress theme framework with Custom Menu, Header and Background along with Logo, Favicon, Featured Image, Google Custom Search Integration and more options. Now includes a Foundation 5 framework, Grunt Task Runner, Bower package manager, SAAS based CSS preprocessor and translation support. This theme comes with free technical support by team of 30+ full-time developers.
Version: 4.0.1
Version: 4.1
Author: rtCamp
Author URI: http://rtcamp.com/
Contributors: rtCampers ( http://rtcamp.com/about/rtcampers/ )
Expand Down
2 changes: 0 additions & 2 deletions footer.php
Expand Up @@ -53,7 +53,5 @@
</div><!-- #main-wrapper -->

<?php wp_footer(); ?>

<?php rtp_hook_end_body(); ?>
</body>
</html>
2 changes: 1 addition & 1 deletion functions.php
Expand Up @@ -7,7 +7,7 @@
* @since rtPanel 2.0
*/

define( 'RTP_VERSION', '4.0' );
define( 'RTP_VERSION', '4.1' );

/* Define Links */
define( 'RTP_AUTHOR_URL', 'https://rtcamp.com/' ); // Theme Author URL
Expand Down
4 changes: 1 addition & 3 deletions header.php
Expand Up @@ -14,7 +14,7 @@
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php echo ( is_home() || is_front_page() ) ? get_bloginfo( 'name', 'display' ) . " | " . get_bloginfo( 'description', 'display' ) : wp_title( '|', true, 'right' ) . get_bloginfo( 'name', 'display' ); ?></title>
<title><?php echo ( is_home() || is_front_page() ) ? get_bloginfo( 'name', 'display' ) . ( !empty( get_bloginfo( 'description', 'display' ) ) ? " | " . get_bloginfo( 'description', 'display' ) : '' ) : wp_title( '|', true, 'right' ) . get_bloginfo( 'name', 'display' ); ?></title>

<!-- Mobile Viewport Fix ( j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag ) -->
<meta name="viewport" content="<?php echo apply_filters( 'rtp_viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0' ); ?>" />
Expand All @@ -26,8 +26,6 @@
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_head(); ?>

<?php rtp_head(); ?>
</head>

<body <?php body_class(); ?>><!-- ends in footer.php -->
Expand Down
26 changes: 25 additions & 1 deletion lib/rtp-init.php
Expand Up @@ -259,4 +259,28 @@ function rtp_general_sanitize_option(){

return apply_filters( 'option_' . $option, maybe_unserialize( $value ) );
}
add_filter( 'pre_option_rtp_general','rtp_general_sanitize_option', 1 );
add_filter( 'pre_option_rtp_general','rtp_general_sanitize_option', 1 );

/**
* rtp_head() function call in wp_head
*
* @since rtPanel 4.1
*/
function rtp_head_call() {
if ( function_exists( 'rtp_head' ) ) {
rtp_head();
}
}
add_action( 'wp_head', 'rtp_head_call', 999 );

/**
* rtp_hook_end_body() function call in wp_footer
*
* @since rtPanel 4.1
*/
function rtp_footer_call() {
if ( function_exists( 'rtp_hook_end_body' ) ) {
rtp_hook_end_body();
}
}
add_action( 'wp_footer', 'rtp_footer_call', 999 );
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "rtPanel",
"version": "4.0.1",
"version": "4.1",
"dependencies": {
"load-grunt-tasks": "~0.2.1"
},
Expand Down
8 changes: 2 additions & 6 deletions readme.txt
Expand Up @@ -2,7 +2,7 @@
Theme Name: rtPanel
Theme URI: http://rtcamp.com/rtpanel/
Description: WordPress theme framework with Custom Menu, Header and Background along with Logo, Favicon, Featured Image, Google Custom Search Integration and more options. Now includes a Foundation 5 framework, Grunt Task Runner, Bower package manager, SAAS based CSS preprocessor and translation support. This theme comes with free technical support by team of 30+ full-time developers. Support Links: <a href="http://rtcamp.com/support/forum/rtpanel/" title="rtPanel Free Support" rel="follow">rtPanel Support forum</a>, <a href="http://rtcamp.com/rtpanel/docs/" title="rtPanel Documentation" rel="follow">Documentation</a> or visit <a href="http://rtcamp.com/rtpanel/" title="rtPanel" rel="follow">rtPanel</a>.
Version: 4.0.1
Version: 4.1
Author: rtCamp
Author URI: http://rtcamp.com/
Contributors: rtCampers ( http://rtcamp.com/about/rtcampers/ )
Expand Down Expand Up @@ -43,11 +43,7 @@ If you make changes to thumbnail height, width or crop settings, you must use "R

== Changelog ==

= 4.0.1 =
* Modified: CSS Classes
* Resolved: Minor Bugs

= 4.0 =
= 4.1 =
* Added: Foundation 5 Framework, Grunt Task Runner, Bower Package Manager
* Added: Support for WooCommerce, rtMedia, BuddyPress, bbPress, Gravity Form, Ninja Form Plugins
* Modified: rtPanel theme options, UI and CSS Classes
Expand Down
2 changes: 1 addition & 1 deletion style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7061920

Please sign in to comment.