Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions classes/class-astra-hooks-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function __construct() {

$this->includes();

add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_register', array( $this, 'customize_register' ) );
add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) );
add_action( 'customize_register', array( $this, 'customize_register' ) );

}

Expand All @@ -53,9 +53,9 @@ public function __construct() {
function theme_defaults( $defaults ) {

// Header.
$defaults['hook-wp-head'] = '';
$defaults['hook-header-before'] = '';
$defaults['hook-header-after'] = '';
$defaults['hook-wp-head'] = '';
$defaults['hook-header-before'] = '';
$defaults['hook-header-after'] = '';

// Content.
$defaults['hook-before-container'] = '';
Expand All @@ -68,17 +68,17 @@ function theme_defaults( $defaults ) {
$defaults['hook-after-container'] = '';

// Comment.
$defaults['hook-comments-before'] = '';
$defaults['hook-comments-after'] = '';
$defaults['hook-comments-before'] = '';
$defaults['hook-comments-after'] = '';

// Sidebar.
$defaults['hook-sidebars-before'] = '';
$defaults['hook-sidebars-after'] = '';
$defaults['hook-sidebars-before'] = '';
$defaults['hook-sidebars-after'] = '';

// Footer.
$defaults['hook-footer-before'] = '';
$defaults['hook-footer-after'] = '';
$defaults['hook-wp-footer'] = '';
$defaults['hook-footer-before'] = '';
$defaults['hook-footer-after'] = '';
$defaults['hook-wp-footer'] = '';

return $defaults;
}
Expand Down
70 changes: 35 additions & 35 deletions classes/class-astra-hooks-markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,176 +37,176 @@ public static function get_instance() {
public function __construct() {

// Header.
add_action( 'wp_head', array( $this, 'hook_wp_head' ) );
add_action( 'astra_header_before', array( $this, 'hook_header_before' ) );
add_action( 'astra_header_after', array( $this, 'hook_header_after' ) );
add_action( 'wp_head', array( $this, 'hook_wp_head' ) );
add_action( 'astra_header_before', array( $this, 'hook_header_before' ) );
add_action( 'astra_header_after', array( $this, 'hook_header_after' ) );

// Sidebar.
add_action( 'astra_sidebars_before', array( $this, 'hook_sidebars_before' ) );
add_action( 'astra_sidebars_after', array( $this, 'hook_sidebars_after' ) );
add_action( 'astra_sidebars_before', array( $this, 'hook_sidebars_before' ) );
add_action( 'astra_sidebars_after', array( $this, 'hook_sidebars_after' ) );

// Footer.
add_action( 'astra_footer_before', array( $this, 'hook_footer_before' ) );
add_action( 'astra_footer_after', array( $this, 'hook_footer_after' ) );
add_action( 'wp_footer', array( $this, 'hook_wp_footer' ) );
add_action( 'astra_footer_before', array( $this, 'hook_footer_before' ) );
add_action( 'astra_footer_after', array( $this, 'hook_footer_after' ) );
add_action( 'wp_footer', array( $this, 'hook_wp_footer' ) );

// Content.
add_action( 'astra_content_before', array( $this, 'hook_container_before' ) );
add_action( 'astra_primary_content_top', array( $this, 'hook_before_main_content' ) );
add_action( 'astra_entry_top', array( $this, 'hook_entry_top' ) );
add_action( 'astra_entry_content_before', array( $this, 'hook_entry_content_before' ) );
add_action( 'astra_entry_content_after', array( $this, 'hook_entry_content_after' ) );
add_action( 'astra_entry_bottom', array( $this, 'hook_entry_bottom' ) );
add_action( 'astra_content_before', array( $this, 'hook_container_before' ) );
add_action( 'astra_primary_content_top', array( $this, 'hook_before_main_content' ) );
add_action( 'astra_entry_top', array( $this, 'hook_entry_top' ) );
add_action( 'astra_entry_content_before', array( $this, 'hook_entry_content_before' ) );
add_action( 'astra_entry_content_after', array( $this, 'hook_entry_content_after' ) );
add_action( 'astra_entry_bottom', array( $this, 'hook_entry_bottom' ) );
add_action( 'astra_primary_content_bottom', array( $this, 'hook_after_main_content' ) );
add_action( 'astra_content_after', array( $this, 'hook_container_after' ) );
add_action( 'astra_content_after', array( $this, 'hook_container_after' ) );

// Comment.
add_action( 'astra_comments_before', array( $this, 'hook_comments_before' ) );
add_action( 'astra_comments_after', array( $this, 'hook_comments_after' ) );
add_action( 'astra_comments_before', array( $this, 'hook_comments_before' ) );
add_action( 'astra_comments_after', array( $this, 'hook_comments_after' ) );

}

/**
* Ast wp_head Hook
*/
function hook_wp_head() {
$wp_head = astra_get_option( 'hook-wp-head' );
$wp_head = astra_get_option( 'hook-wp-head' );
echo do_shortcode( $wp_head );
}

/**
* Ast Header Before Hook
*/
function hook_header_before() {
$header_before = astra_get_option( 'hook-header-before' );
$header_before = astra_get_option( 'hook-header-before' );
echo do_shortcode( $header_before );
}

/**
* Ast Header After Hook
*/
function hook_header_after() {
$header_after = astra_get_option( 'hook-header-after' );
$header_after = astra_get_option( 'hook-header-after' );
echo do_shortcode( $header_after );
}

/**
* Ast Page/Post Before Main Container Hook
*/
function hook_container_before() {
$hook_container_before = astra_get_option( 'hook-before-container' );
$hook_container_before = astra_get_option( 'hook-before-container' );
echo do_shortcode( $hook_container_before );
}

/**
* Ast Page/Post Before Main Content Hook
*/
function hook_before_main_content() {
$hook_before_main_content = astra_get_option( 'hook-before-main-content' );
$hook_before_main_content = astra_get_option( 'hook-before-main-content' );
echo do_shortcode( $hook_before_main_content );
}

/**
* Ast Page/Post Before Hook
*/
function hook_entry_top() {
$entry_top = astra_get_option( 'hook-entry-top' );
$entry_top = astra_get_option( 'hook-entry-top' );
echo do_shortcode( $entry_top );
}

/**
* Ast Page/Post After Hook
*/
function hook_entry_bottom() {
$entry_bottom = astra_get_option( 'hook-entry-bottom' );
$entry_bottom = astra_get_option( 'hook-entry-bottom' );
echo do_shortcode( $entry_bottom );
}

/**
* Ast Page/Post After Main Content Hook
*/
function hook_after_main_content() {
$hook_after_main_content = astra_get_option( 'hook-after-main-content' );
$hook_after_main_content = astra_get_option( 'hook-after-main-content' );
echo do_shortcode( $hook_after_main_content );
}

/**
* Ast Page/Post After Main Container Hook
*/
function hook_container_after() {
$hook_container_after = astra_get_option( 'hook-after-container' );
$hook_container_after = astra_get_option( 'hook-after-container' );
echo do_shortcode( $hook_container_after );
}

/**
* Ast After Entry Content Before Hook
*/
function hook_entry_content_before() {
$after_entry_title = astra_get_option( 'hook-entry-content-before' );
$after_entry_title = astra_get_option( 'hook-entry-content-before' );
echo do_shortcode( $after_entry_title );
}

/**
* Ast After Entry Content After Hook
*/
function hook_entry_content_after() {
$after_entry_title = astra_get_option( 'hook-entry-content-after' );
$after_entry_title = astra_get_option( 'hook-entry-content-after' );
echo do_shortcode( $after_entry_title );
}

/**
* Ast Comment Before Hook
*/
function hook_comments_before() {
$comment_before = astra_get_option( 'hook-comments-before' );
$comment_before = astra_get_option( 'hook-comments-before' );
echo do_shortcode( $comment_before );
}

/**
* Ast Comment After Hook
*/
function hook_comments_after() {
$comment_after = astra_get_option( 'hook-comments-after' );
$comment_after = astra_get_option( 'hook-comments-after' );
echo do_shortcode( $comment_after );
}

/**
* Ast Sidebars Before Hook
*/
function hook_sidebars_before() {
$sidebar_before = astra_get_option( 'hook-sidebars-before' );
$sidebar_before = astra_get_option( 'hook-sidebars-before' );
echo do_shortcode( $sidebar_before );
}

/**
* Ast Sidebars After Hook
*/
function hook_sidebars_after() {
$sidebar_after = astra_get_option( 'hook-sidebars-after' );
$sidebar_after = astra_get_option( 'hook-sidebars-after' );
echo do_shortcode( $sidebar_after );
}

/**
* Ast Footer Before Hook
*/
function hook_footer_before() {
$footer_before = astra_get_option( 'hook-footer-before' );
$footer_before = astra_get_option( 'hook-footer-before' );
echo do_shortcode( $footer_before );
}

/**
* Ast Footer After Hook
*/
function hook_footer_after() {
$footer_after = astra_get_option( 'hook-footer-after' );
$footer_after = astra_get_option( 'hook-footer-after' );
echo do_shortcode( $footer_after );
}

/**
* Ast wp_head Hook
*/
function hook_wp_footer() {
$wp_footer = astra_get_option( 'hook-wp-footer' );
$wp_footer = astra_get_option( 'hook-wp-footer' );
echo do_shortcode( $wp_footer );
}
}
Expand Down
26 changes: 13 additions & 13 deletions classes/class-astra-hooks-white-label.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public static function set_instance() {
*/
public function __construct() {

add_filter( 'all_plugins' , array( $this, 'plugins_page' ) );
add_filter( 'astra_addon_branding_options' , __CLASS__ . '::settings' );
add_action( 'astra_pro_white_label_add_form' , __CLASS__ . '::add_white_lavel_form' );
add_filter( 'all_plugins', array( $this, 'plugins_page' ) );
add_filter( 'astra_addon_branding_options', __CLASS__ . '::settings' );
add_action( 'astra_pro_white_label_add_form', __CLASS__ . '::add_white_lavel_form' );

if ( is_admin() ) {
// Display the link with the plugin meta.
Expand All @@ -71,7 +71,7 @@ public function __construct() {
*/
function plugins_page( $plugins ) {

$get_white_label = 'Astra_Ext_White_Label_Markup::get_white_label';
$get_white_label = 'Astra_Ext_White_Label_Markup::get_whitelabel_string';
if ( ! is_callable( $get_white_label ) ) {
return $plugins;
}
Expand All @@ -81,10 +81,10 @@ function plugins_page( $plugins ) {
}

// Set White Labels.
$name = Astra_Ext_White_Label_Markup::get_white_label( 'astra-hooks', 'name' );
$description = Astra_Ext_White_Label_Markup::get_white_label( 'astra-hooks', 'description' );
$author = Astra_Ext_White_Label_Markup::get_white_label( 'astra-agency', 'author' );
$author_uri = Astra_Ext_White_Label_Markup::get_white_label( 'astra-agency', 'author_url' );
$name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-hooks', 'name' );
$description = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-hooks', 'description' );
$author = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-agency', 'author' );
$author_uri = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-agency', 'author_url' );

if ( ! empty( $name ) ) {
$plugins[ ASTRA_HOOKS_BASE ]['Name'] = $name;
Expand Down Expand Up @@ -120,11 +120,11 @@ function plugins_page( $plugins ) {
*/
public function plugin_links( $plugin_meta, $plugin_file, $plugin_data ) {

if ( is_callable( 'Astra_Ext_White_Label_Markup::get_white_label' ) ) {
if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
if ( ASTRA_HOOKS_BASE == $plugin_file ) {
// Set White Labels.
$name = Astra_Ext_White_Label_Markup::get_white_label( 'astra-hooks', 'name' );
$description = Astra_Ext_White_Label_Markup::get_white_label( 'astra-hooks', 'description' );
$name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-hooks', 'name' );
$description = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-hooks', 'description' );

if ( ! empty( $name ) ) {
// Remove Plugin URI if Agency White Label name is set.
Expand All @@ -146,8 +146,8 @@ public function plugin_links( $plugin_meta, $plugin_file, $plugin_data ) {
public static function settings( $settings = array() ) {

$settings['astra-hooks'] = array(
'name' => '',
'description' => '',
'name' => '',
'description' => '',
);

return $settings;
Expand Down
40 changes: 23 additions & 17 deletions classes/customizer-panels-and-sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,49 @@
*/

$wp_customize->add_panel(
'panel-hooks', array(
'panel-hooks',
array(
'priority' => 55,
'title' => __( 'Hooks', 'astra-hooks' ),
'title' => __( 'Hooks', 'astra-hooks' ),
)
);

$wp_customize->add_section(
'section-hooks-header', array(
'title' => __( 'Header', 'astra-hooks' ),
'panel' => 'panel-hooks',
'section-hooks-header',
array(
'title' => __( 'Header', 'astra-hooks' ),
'panel' => 'panel-hooks',
)
);

$wp_customize->add_section(
'section-hooks-content', array(
'title' => __( 'Content', 'astra-hooks' ),
'panel' => 'panel-hooks',
'section-hooks-content',
array(
'title' => __( 'Content', 'astra-hooks' ),
'panel' => 'panel-hooks',
)
);

$wp_customize->add_section(
'section-hooks-comment', array(
'title' => __( 'Comment', 'astra-hooks' ),
'panel' => 'panel-hooks',
'section-hooks-comment',
array(
'title' => __( 'Comment', 'astra-hooks' ),
'panel' => 'panel-hooks',
)
);

$wp_customize->add_section(
'section-hooks-sidebar', array(
'title' => __( 'Sidebar', 'astra-hooks' ),
'panel' => 'panel-hooks',
'section-hooks-sidebar',
array(
'title' => __( 'Sidebar', 'astra-hooks' ),
'panel' => 'panel-hooks',
)
);

$wp_customize->add_section(
'section-hooks-footer', array(
'title' => __( 'Footer', 'astra-hooks' ),
'panel' => 'panel-hooks',
'section-hooks-footer',
array(
'title' => __( 'Footer', 'astra-hooks' ),
'panel' => 'panel-hooks',
)
);
Loading