'' . esc_html__('Settings', 'add-anchor-links') . '', ); return array_merge($action_links, $links); } // Load scripts and styles function add_anchor_links_scripts() { if ( is_singular( add_anchor_links_post_types( true ) ) ) { wp_enqueue_style('add-anchor-links-style', ADD_ANCHOR_LINKS_URL . 'assets/css/add-anchor-links.css', array(), ADD_ANCHOR_LINKS_VERSION ); } } // Default options function add_anchor_links_options_defaults() { $default_options = array( 'own_css' => false, 'post_types' => false, ); $post_types = add_anchor_links_post_types(); foreach ( $post_types as $pt ) { $default_options[$pt] = false; } return $default_options; } // Get post types function add_anchor_links_post_types( $active = false ) { $post_types = get_post_types( array( 'public' => true, ) ); if ( $active ) { global $add_anchor_links_options; $_post_types = $post_types; foreach( $_post_types as $pt ) { if ( isset($add_anchor_links_options[$pt] ) && $add_anchor_links_options[$pt] ) { $post_types[] = $pt; } } } return $post_types; }