Skip to content

Instantly share code, notes, and snippets.

@billrobbins
Created February 1, 2021 16:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save billrobbins/48eec3550f27b62f5b2eb26d98b46c59 to your computer and use it in GitHub Desktop.
function sv_facebook_feed_url_admin_notice(){
if ( class_exists( 'WC_Facebook_Product_Feed' ) ) {
$feed_file_url = class_exists( 'SkyVerge\WooCommerce\Facebook\Products\Feed' ) ? get_bloginfo( 'url' ) . '/?wc-api=wc_facebook_get_feed_data&secret=' . SkyVerge\WooCommerce\Facebook\Products\Feed::get_feed_secret() : '';
if ( ( isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) &&
( 'wc-settings' == $_GET['page'] && 'integration' == $_GET['tab'] &&
'facebookcommerce' == $_GET['section'] ) ) ||
( isset( $_GET['page'] ) && 'wc-facebook' == $_GET['page'] ) ) {
echo '<div class="notice notice-warning">';
echo '<p>Feed URL: <a href="' . $feed_file_url . '">' . $feed_file_url . '</a></p>';
echo '</div>';
}
}
}
add_action( 'admin_notices', 'sv_facebook_feed_url_admin_notice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment