render shortcode and include image in help metabox

This commit is contained in:
jorge-vitrubio 2022-07-23 16:29:03 +02:00
parent 6adc0b13fb
commit a91c74f025
3 changed files with 9 additions and 6 deletions

BIN
assets/img/PFC-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -44,7 +44,9 @@ define( 'HANGAR_WPPLUGIN_VERSION', '1.0.0' );
* define Plugin path
* https://developer.wordpress.org/reference/functions/plugin_dir_path/#comment-1113
* * * * * * * * * * * * * * * * * * */
define( 'HANGAR_WPPLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'HANGAR_WPPLUGIN_PATH', plugin_dir_path( __FILE__ ) ); //in server
define( 'HANGAR_WPPLUGIN_URL', plugin_dir_url( __FILE__ ) ); //public
include( HANGAR_WPPLUGIN_PATH . 'includes/hangar-init-textdomain.php');

View File

@ -64,8 +64,8 @@ if ( ! function_exists( 'hangar_extra_content_callback' ) ) :
$hangar_extra_content_stored_meta = get_post_meta( $post->ID );
?>
<p>
<span class="row hangar-title"><?php _e( 'Estas son las opciones de cada entrada o página de la web.', 'hangar-wpplugin-textdomain' )?></span>
<span class="row hangar-title"><?php _e( 'Para mostrar las entradas o páginas debes poner el <pre>[shortcode]</pre> que genera el icono <em>PFC</em> que ves en la barra de edición de texto.', 'hangar-wpplugin-textdomain' )?></span>
<span class="row hangar-title"><?php _e( 'Estas son las opciones de cada <em>entrada</em> o <em>página</em> de la web.', 'hangar-wpplugin-textdomain' )?></span>
<span class="row hangar-title"><?php _e( 'Para mostrar las entradas o páginas debes poner el <code>[shortcode]</code> que genera el icono <img src="' . HANGAR_WPPLUGIN_URL . 'assets/img/PFC-icon.png" alt="PFC icon" style="margin-bottom:-8px;"/> que ves en la barra de edición de texto.', 'hangar-wpplugin-textdomain' )?></span>
<div class="row hangar-content">
</div>
</p>
@ -79,7 +79,7 @@ if ( ! function_exists( 'hangar_extra_content_callback' ) ) :
$settings = array(
'textarea_name' => 'hangar_extra_content_wysiwyg_summary',
'media_buttons' => true,
'textarea_rows' => 3,
'textarea_rows' => 10,
// https://www.kevinleary.net/customizing-tinymce-wysiwyg-editor-wordpress/
// 'tinymce' => array(
// 'toolbar1' => 'formatselect,bold,italic,link,unlink,charmap,removeformat,wp_more',
@ -133,8 +133,9 @@ if ( ! function_exists( 'hangar_show_extra_content' ) ) :
$meta_value = get_post_meta( get_the_ID(), 'hangar_extra_content_wysiwyg_summary', true );
// Checks and displays the retrieved value
if( !empty( $meta_value ) ) {
echo '<div class="hangar-">';
echo $meta_value;
echo '<div class="hangar-extra-content">';
// to do shortcodes: https://developer.wordpress.org/reference/functions/apply_filters/
echo apply_filters( 'the_content', $meta_value);
echo '</div>';
}
}