Skip to content

Commit

Permalink
add integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
picocodes committed Jan 17, 2025
1 parent 12754b0 commit fb90394
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/Integrations/Elementor/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function __construct() {

// Register form action.
add_action( 'elementor_pro/init', array( $this, 'register_form_action' ) );
add_filter( 'noptin_register_post_type_object_elementor_library', '__return_false' );
add_filter( 'noptin_register_post_type_object_e-floating-buttons', '__return_false' );
}

/**
Expand Down
7 changes: 0 additions & 7 deletions src/Integrations/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ private function is_integration_usable( $config ) {
}

if ( $current_theme->get( 'Name' ) !== $value['name'] ) {
$this->notices[ $config['label'] ] = sprintf(
// translators: %1$s is the integration label, %2$s is the required theme.
__( 'The %1$s integration requires the %2$s theme.', 'newsletter-optin-box' ),
$config['label'],
$value['name']
);

return false;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Integrations/integrations.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Objects/Generic_Post_Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,11 @@ public static function register() {
'show_ui' => true,
);

$exclude = apply_filters( 'noptin_post_type_exclude', array( 'elementor_library', 'attachment' ) );
$exclude = apply_filters( 'noptin_post_type_exclude', array( 'attachment', 'elementor_library', 'e-floating-buttons' ) );

foreach ( get_post_types( $args ) as $type ) {
if ( ! Store::exists( $type ) && ! in_array( $type, $exclude, true ) ) {
$register = apply_filters( 'noptin_register_post_type_object_' . $type, true );
if ( $register && ! Store::exists( $type ) && ! in_array( $type, $exclude, true ) ) {
Store::add( new Generic_Post_Type( $type, true ) );
}
}
Expand Down

0 comments on commit fb90394

Please sign in to comment.