geno/wp-content/plugins/astra-sites/inc/lib/bsf-quick-links
2024-02-01 11:54:18 +00:00
..
class-bsf-quick-links.php first commit 2024-02-01 11:54:18 +00:00
quicklink.css first commit 2024-02-01 11:54:18 +00:00
quicklinks.js first commit 2024-02-01 11:54:18 +00:00
readme.md first commit 2024-02-01 11:54:18 +00:00

BSF Quick Links

BSF Quick Links allows you to show a list of your most commonly used links and access them from our plugins settings page

Example

  • Upgrade to Pro.
  • Documentation
  • Join our community and access them from our plugins settings page.

How to use?

@see 3c42ceeeb4/inc/classes/class-astra-sites.php (L143)

  • Add below action into respective plugins settings page.
    add_action( 'admin_footer', array( $this, 'add_quick_links' ) );
  • Callback function
public function add_quick_links() {
    $current_screen = get_current_screen();

    if ( 'plugin_settings_screen_name' !== $current_screen->id ) {
        return;
    }

    if ( Astra_Sites_White_Label::get_instance()->is_white_labeled() ) {
        return;
    }
    
    $data = array(
        'default_logo' => array(
            'title' => '', //title on logo hover.
            'url'   => '',
            ),
        'links'        => array(
            array('label' => '','icon' => '','url' => ''),
            array('label' => '','icon' => '','url' => ''),
            array('label' => '','icon' => '','url' => ''),
            ...
        )
    );
    if ( defined( 'ASTRA_PRO_SITES_VER' ) ) { 
		array_shift( $data['links'] ); //Exclude upgrade to pro link.
	}

	bsf_quick_links( $data );
}