diff --git a/.gitignore b/.gitignore index 27169169..80204d3e 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,7 @@ Thumbs.db # track these mu-plugins, plugins, and themes # add your own entries here +!wp-content/plugins/aircraft !wp-content/plugins/aerospace-google-analytics.php !wp-content/plugins/aerospace-menu-item-custom-fields.php !wp-content/plugins/search-filter-pro diff --git a/wp-content/plugins/aircraft/aircraft.js b/wp-content/plugins/aircraft/aircraft.js new file mode 100644 index 00000000..51d2a8f0 --- /dev/null +++ b/wp-content/plugins/aircraft/aircraft.js @@ -0,0 +1,27 @@ +( function( wp ) { + + const aircraftShortcode = function ( props ) { + return wp.element.createElement( + wp.editor.RichTextToolbarButton, { + icon: 'editor-code', + title: 'Aircraft Shortcode', + onClick: function() { + props.onChange( wp.richText.insert( + props.value, + valueToInsert = '[aircraft]', + startIndex = props.value.start, + endIndex = props.value.end + )); + }, + } + ) + } + wp.richText.registerFormatType( + 'aircraft-shortcode/sample-output',{ + title: 'Aircraft Shortcode', + tagName: 'samp', + className: null, + edit: aircraftShortcode + } + ); +})( window.wp ); \ No newline at end of file diff --git a/wp-content/plugins/aircraft/aircraft.php b/wp-content/plugins/aircraft/aircraft.php new file mode 100644 index 00000000..0363d382 --- /dev/null +++ b/wp-content/plugins/aircraft/aircraft.php @@ -0,0 +1,19 @@ +ID, '_post_disable_highlights', true ); $current_disable_feature_img = get_post_meta( $post->ID, '_post_disable_feature_img', true ); $current_report_cover_url = get_post_meta( $post->ID, '_post_report_cover_url', true ); - $current_disable_post_bottom_icon = get_post_meta( $post->ID, '_post_disable_post_bottom_icon', true ); $current_disable_post_authors = get_post_meta( $post->ID, '_post_disable_post_authors', true ); $current_disable_post_categories = get_post_meta( $post->ID, '_post_disable_post_categories', true ); $current_custom_css = get_post_meta( $post->ID, '_post_custom_css', true ); @@ -207,12 +206,6 @@ function post_save_meta_box_data( $post_id ) { } else { update_post_meta( $post_id, '_post_disable_feature_img', '' ); } - // Disable Icon at Bottom of posts. - if ( isset( $_REQUEST['disable_post_bottom_icon'] ) ) { - update_post_meta( $post_id, '_post_disable_post_bottom_icon', sanitize_text_field( $_POST['disable_post_bottom_icon'] ) ); - } else { - update_post_meta( $post_id, '_post_disable_post_bottom_icon', '' ); - } // Disable Authors at Bottom of the post. if ( isset( $_REQUEST['disable_post_authors'] ) ) { update_post_meta( $post_id, '_post_disable_post_authors', sanitize_text_field( $_POST['disable_post_authors'] ) ); diff --git a/wp-content/themes/aerospace/inc/template-functions.php b/wp-content/themes/aerospace/inc/template-functions.php index 1b70afde..5e73f746 100755 --- a/wp-content/themes/aerospace/inc/template-functions.php +++ b/wp-content/themes/aerospace/inc/template-functions.php @@ -140,17 +140,17 @@ function aerospace_img_caption_shortcode_filter($val, $attr, $content = null) * @param string $content The post content. * @return string The modified post content. */ -function aerospace_add_logo_to_post_content( $content ) { - global $post; - if ( $post->post_type == 'post' ) { - $disable_icon = get_post_meta( $post->ID, '_post_disable_post_bottom_icon', true ); - if ( ! $disable_icon ) { - $content .= do_shortcode('[aircraft]'); - } - } - return $content; -} -add_filter('the_content', 'aerospace_add_logo_to_post_content', 0); +// function aerospace_add_logo_to_post_content( $content ) { +// global $post; +// if ( $post->post_type == 'post' ) { +// $disable_icon = get_post_meta( $post->ID, '_post_disable_post_bottom_icon', true ); +// if ( ! $disable_icon ) { +// $content .= do_shortcode('[aircraft]'); +// } +// } +// return $content; +// } +// add_filter('the_content', 'aerospace_add_logo_to_post_content', 0); /** * Fixes empty

and
tags showing before and after shortcodes in the