-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3500 from Automattic/feat/ia-audience
feat(ia): audience configuration boilerplate
- Loading branch information
Showing
29 changed files
with
1,500 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* Audience Campaigns Wizard | ||
* | ||
* @package Newspack | ||
*/ | ||
|
||
namespace Newspack; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
/** | ||
* Audience Campaigns Wizard. | ||
*/ | ||
class Audience_Campaigns extends Wizard { | ||
|
||
/** | ||
* Admin page slug. | ||
* | ||
* @var string | ||
*/ | ||
protected $slug = 'newspack-audience-campaigns'; | ||
|
||
/** | ||
* Parent slug. | ||
* | ||
* @var string | ||
*/ | ||
protected $parent_slug = 'newspack-audience-configuration'; | ||
|
||
/** | ||
* Get the name for this wizard. | ||
* | ||
* @return string The wizard name. | ||
*/ | ||
public function get_name() { | ||
return esc_html__( 'Audience Development / Campaigns', 'newspack-plugin' ); | ||
} | ||
|
||
/** | ||
* Enqueue scripts and styles. | ||
*/ | ||
public function enqueue_scripts_and_styles() { | ||
if ( ! $this->is_wizard_page() ) { | ||
return; | ||
} | ||
|
||
parent::enqueue_scripts_and_styles(); | ||
|
||
wp_enqueue_script( 'newspack-wizards' ); | ||
} | ||
|
||
/** | ||
* Add Audience top-level and Campaigns subpage to the /wp-admin menu. | ||
*/ | ||
public function add_page() { | ||
add_submenu_page( | ||
$this->parent_slug, | ||
$this->get_name(), | ||
esc_html__( 'Campaigns', 'newspack-plugin' ), | ||
$this->capability, | ||
$this->slug, | ||
[ $this, 'render_wizard' ] | ||
); | ||
} | ||
} |
Oops, something went wrong.