Skip to content

Commit

Permalink
#1404 Code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Nov 16, 2017
1 parent c1f6104 commit a7ac927
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions accelerated-moblie-pages.php
Expand Up @@ -80,6 +80,7 @@ function ampforwp_get_the_page_id_blog_page(){

// Add Custom Rewrite Rule to make sure pagination & redirection is working correctly
function ampforwp_add_custom_rewrite_rules() {
global $redux_builder_amp;
// For Homepage
add_rewrite_rule(
'amp/?$',
Expand Down Expand Up @@ -176,6 +177,10 @@ function ampforwp_add_custom_rewrite_rules() {
);
}
}
// For OneSignal
if(isset($redux_builder_amp['ampforwp-web-push-onesignal']) && $redux_builder_amp['ampforwp-web-push-onesignal'] ){
add_rewrite_rule('OneSignalSDKWorker.js','wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/OneSignalSDKWorker.js','top');
}
}
add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );

Expand Down
7 changes: 0 additions & 7 deletions templates/features.php
Expand Up @@ -4916,13 +4916,6 @@ function ampforwp_onesignal_notifications_styling(){
<?php }
}
}
// Rewrite Rule for Onesignal Service worker to make it work properly
add_action( 'init', 'ampforwp_custom_rewrite_rule_onesignal' );
if( ! function_exists('ampforwp_custom_rewrite_rule_onesignal')){
function ampforwp_custom_rewrite_rule_onesignal(){
add_rewrite_rule('OneSignalSDKWorker.js','wp-content/plugins/accelerated-mobile-pages/includes/onesignal-integration/OneSignalSDKWorker.js','top');
}
}
// 95. Modify menu link attributes for SiteNavigationElement Schema Markup #1229 #1345
add_filter( 'nav_menu_link_attributes', 'ampforwp_nav_menu_link_attributes', 10, 3 );
if( ! function_exists( 'ampforwp_nav_menu_link_attributes' ) ) {
Expand Down

0 comments on commit a7ac927

Please sign in to comment.