__( '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 = isset($placement['options']['pro_custom_position']) ? $placement['options']['pro_custom_position'] : ''; $inject_by = isset( $placement['options']['inject_by'] ) ? $placement['options']['inject_by'] : 'pro_custom_element'; $container_id = ! empty( $placement['options']['container_id'] ) ? $placement['options']['container_id'] : '#c' . md5( $placement_slug ); ob_start(); ?>

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

', substr( $container_id, 1 ) ) ); ?>"> '; $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' ); if( class_exists( 'Advanced_Ads_Admin_Options' ) ){ Advanced_Ads_Admin_Options::render_option( 'placement-infeed-position', __( 'position', 'advanced-ads-pro' ), $option_content, $description ); } /*$curr_type = isset($placement['options']['pro_archive_pages_type']) ? $placement['options']['pro_archive_pages_type'] : ''; $types = array( 'container' => __( 'post container', 'advanced-ads-pro' ), 'content' => __( 'post content', 'advanced-ads-pro' ), ); ?>*/ break; } } /** * render minimum content length option for content injection placements * * @since 1.2.3 * @param string $placement_slug id of the placement * */ public function minimum_content_length_option( $placement_slug, $placement ){ switch ( $placement['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( $placement['options']['pro_minimum_length'] ) ? absint( $placement['options']['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' ); if( class_exists( 'Advanced_Ads_Admin_Options' ) ){ Advanced_Ads_Admin_Options::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 Id of the placement * @param array $placement Placement params. */ public function in_any_loop_archive_pages_option( $placement_slug, $placement ) { switch ( $placement['type'] ) { case 'archive_pages' : $options = advanced_ads_pro::get_instance()->get_options(); $in_any_loop = ! empty( $placement['options']['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' ); if ( class_exists( 'Advanced_Ads_Admin_Options' ) ) { Advanced_Ads_Admin_Options::render_option( 'placement-infeed-any-loop', __( 'secondary loops', 'advanced-ads-pro' ), $option_content, $description ); } break; } } /** * load frontend picker javascript * * @since 1.1.2 * @param arr $placements active placements */ public function frontend_picker_script( $placements ){ // Check if the following code is included in the basic plugin. if ( 0 <= version_compare( ADVADS_VERSION, '1.19' ) ) { return; } ?>