Astra_Ext_Advanced_Hooks_Meta::php_editor_markup( object $post )
Markup PHP snippt editor.
Description
Parameters
- $post
-
(object) (Required) Post Object.
Source
File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-meta.php
public function php_editor_markup( $post ) { // Get all posts. $post_type = get_post_type(); if ( ASTRA_ADVANCED_HOOKS_POST_TYPE == $post_type ) { wp_nonce_field( basename( __FILE__ ), ASTRA_ADVANCED_HOOKS_POST_TYPE ); $stored = get_post_meta( $post->ID ); // Set stored and override defaults. foreach ( $stored as $key => $value ) { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; } // Get defaults. $meta = self::get_meta_option(); /** * Get options */ $content = ( isset( $meta['ast-advanced-hook-php-code']['default'] ) ) ? $meta['ast-advanced-hook-php-code']['default'] : "<?php\n // Add your snippet here.\n?>"; ?> <div class="wp-editor-container astra-php-editor-container"> <textarea id="ast-advanced-hook-php-code" name="ast-advanced-hook-php-code" class="wp-editor-area ast-advanced-hook-php-content"><?php echo esc_textarea( $content ); ?></textarea> </div> <?php } }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |