get_type() ) { case 'custom_position' : $positions = [ 'insertBefore' => __( 'above', 'advanced-ads-pro' ), 'prependTo' => __( 'inside, before other content', 'advanced-ads-pro' ), 'appendTo' => __( 'inside, after other content', 'advanced-ads-pro' ), 'insertAfter' => __( 'below', 'advanced-ads-pro' ) ]; $curr_position = $placement->get_prop( 'pro_custom_position' ) ?? ''; $inject_by = $placement->get_prop( 'inject_by' ) ?? 'pro_custom_element'; $container_id = $placement->get_prop( 'container_id' ) ?? '#c' . md5( $placement_slug ); ob_start(); ?>

jQuery selectors, e.g. #container_id, .container_class', 'advanced-ads-pro' ); ?>

', substr( $container_id, 1 ) ) ); ?>"> get_prop( 'pro_archive_pages_index' ) ?? 1; $index = Advanced_Ads_Pro_Utils::absint( $index, 1 ); $index_option = ''; /* translators: %s: index of the post */ $option_content = sprintf(__( 'Inject before %s. post', 'advanced-ads-pro' ), $index_option ); $description = __( 'Before which post to inject the ad on post lists.', 'advanced-ads-pro' ); WordPress::render_option( 'placement-infeed-position', __( 'position', 'advanced-ads-pro' ), $option_content, $description ); break; } } /** * render minimum content length option for content injection placements * * @since 1.2.3 * @param string $placement_slug Placement id. * @param Placement $placement Placement instance. * */ public function minimum_content_length_option( $placement_slug, $placement ){ $data = $placement->get_data(); switch ( $placement->get_type() ) { case 'post_top' : case 'post_bottom' : case 'post_content' : case 'post_content_random' : case 'post_content_middle' : $options = Advanced_Ads_Pro::get_instance()->get_options(); $minimum_length = ! empty( $data['pro_minimum_length'] ) ? absint( $data['pro_minimum_length'] ) : 0; $option_content = ''; $description = __( 'Minimum length of content (in words) before automatically injected ads are allowed in them. Set to zero or leave empty to always display ads, regardless of how long the content is.', 'advanced-ads-pro' ); WordPress::render_option( 'placement-content-minimum-length', __( 'minimum content length', 'advanced-ads-pro' ), $option_content, $description ); break; } } /** * Render inject in any loop option for post list placement. * * @param string $placement_slug Placement id. * @param Placement $placement Placement instance. */ public function in_any_loop_archive_pages_option( $placement_slug, $placement ) { $data = $placement->get_data(); switch ( $placement->get_type() ) { case 'archive_pages' : $options = advanced_ads_pro::get_instance()->get_options(); $in_any_loop = ! empty( $data['in_any_loop'] ); $option_content = ''; $description = __( 'Allow injection into any custom and secondary queries.', 'advanced-ads-pro' ); $description .= ' ' . __( 'Only enable this option if you are sure what you are doing!', 'advanced-ads-pro' ); WordPress::render_option( 'placement-infeed-any-loop', __( 'secondary loops', 'advanced-ads-pro' ), $option_content, $description ); break; } } /** * load frontend picker javascript * * @since 1.1.2 */ public function frontend_picker_script(){ $screen = get_current_screen(); // Check if the following code is included in the basic plugin. if ( 0 <= version_compare( ADVADS_VERSION, '1.19' ) || 'edit-advanced_ads_plcmnt' !== $screen->id ) { return; } ?>is_type( [ 'post_content_middle', 'post_top', 'post_bottom', 'post_content' ] ) ) { return; } $data = $placement->get_data(); $words_between_repeats = ! empty( $data['words_between_repeats'] ) ? absint( $data['words_between_repeats'] ) : 0; ob_start(); require AAP_BASE_PATH . '/views/setting_words_between_ads.php'; $setting = ob_Get_clean(); WordPress::render_option( 'advanced-ads-pro-skip-paragraph', __( 'Words between ads', 'advanced-ads-pro' ), $setting ); } }