Changeset 2161744
- Timestamp:
- 09/23/2019 11:21:10 PM (6 years ago)
- Location:
- insert-headers-and-footers
- Files:
-
- 2 edited
-
tags/1.4.4/ihaf.php (modified) (2 diffs)
-
trunk/ihaf.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
insert-headers-and-footers/tags/1.4.4/ihaf.php
r2087406 r2161744 54 54 add_action( 'admin_init', array( &$this, 'registerSettings' ) ); 55 55 add_action( 'admin_menu', array( &$this, 'adminPanelsAndMetaBoxes' ) ); 56 add_action( 'wp_feed_options', array( &$this, 'dashBoardRss' ), 10, 2 );57 56 add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) ); 58 57 add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) ); … … 61 60 add_action( 'wp_head', array( &$this, 'frontendHeader' ) ); 62 61 add_action( 'wp_footer', array( &$this, 'frontendFooter' ) ); 63 64 // Filters 65 add_filter( 'dashboard_secondary_items', array( &$this, 'dashboardSecondaryItems' ) ); 66 } 67 68 /** 69 * Number of Secondary feed items to show 70 */ 71 function dashboardSecondaryItems() { 72 return 6; 73 } 74 75 /** 76 * Update the planet feed to add the WPB feed 77 */ 78 function dashboardRss( $feed, $url ) { 79 // Return early if not on the right page. 80 global $pagenow; 81 if ( 'admin-ajax.php' !== $pagenow ) { 82 return; 83 } 84 85 // Return early if not on the right feed. 86 if ( strpos( $url, 'planet.wordpress.org' ) === false ) { 87 return; 88 } 89 90 // Only move forward if this action hasn't been done already. 91 if ( ! $GLOBALS['wpb_feed_append'] ) { 92 $GLOBALS['wpb_feed_append'] = true; 93 $urls = array( 'http://www.wpbeginner.com/feed/', $url ); 94 $feed->set_feed_url( $urls ); 95 } 96 } 62 } 97 63 98 64 /** -
insert-headers-and-footers/trunk/ihaf.php
r2087406 r2161744 54 54 add_action( 'admin_init', array( &$this, 'registerSettings' ) ); 55 55 add_action( 'admin_menu', array( &$this, 'adminPanelsAndMetaBoxes' ) ); 56 add_action( 'wp_feed_options', array( &$this, 'dashBoardRss' ), 10, 2 );57 56 add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) ); 58 57 add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) ); … … 61 60 add_action( 'wp_head', array( &$this, 'frontendHeader' ) ); 62 61 add_action( 'wp_footer', array( &$this, 'frontendFooter' ) ); 63 64 // Filters 65 add_filter( 'dashboard_secondary_items', array( &$this, 'dashboardSecondaryItems' ) ); 66 } 67 68 /** 69 * Number of Secondary feed items to show 70 */ 71 function dashboardSecondaryItems() { 72 return 6; 73 } 74 75 /** 76 * Update the planet feed to add the WPB feed 77 */ 78 function dashboardRss( $feed, $url ) { 79 // Return early if not on the right page. 80 global $pagenow; 81 if ( 'admin-ajax.php' !== $pagenow ) { 82 return; 83 } 84 85 // Return early if not on the right feed. 86 if ( strpos( $url, 'planet.wordpress.org' ) === false ) { 87 return; 88 } 89 90 // Only move forward if this action hasn't been done already. 91 if ( ! $GLOBALS['wpb_feed_append'] ) { 92 $GLOBALS['wpb_feed_append'] = true; 93 $urls = array( 'http://www.wpbeginner.com/feed/', $url ); 94 $feed->set_feed_url( $urls ); 95 } 96 } 62 } 97 63 98 64 /**
Note: See TracChangeset
for help on using the changeset viewer.