if (PostSnippets::canExecutePHP()) {
            PostSnippets_Admin::checkbox(
                __('PHP Code', PostSnippets::TEXT_DOMAIN),
                $key.'_php',
                $snippet['php']
            );
        }

            $wptexturize = isset( $snippet['wptexturize'] ) ? $snippet['wptexturize'] : false;
            PostSnippets_Admin::checkbox('wptexturize', $key.'_wptexturize', $wptexturize);
            ?>
            </td>
            <td class='desc'>
            <textarea name="<?php echo $key; ?>_snippet" class="large-text" style='width: 100%;' rows="5"><?php echo htmlspecialchars($snippet['snippet'], ENT_NOQUOTES); ?></textarea>
            <?php _e( 'Description', PostSnippets::TEXT_DOMAIN ) ?>:
            <input type='text' style='width: 100%;' name='<?php echo $key; ?>_description' value='<?php if (isset( $snippet['description'] ) ) echo esc_html($snippet['description']); ?>' /><br/>
            </td>
            </tr>
        <?php
            }
        }
        ?>
        </tbody>
    </table>

<?php
        PostSnippets_Admin::submit('update-snippets', __('Update Snippets', PostSnippets::TEXT_DOMAIN));
        PostSnippets_Admin::submit('add-snippet', __('Add New Snippet', PostSnippets::TEXT_DOMAIN), 'button-secondary', false);
        PostSnippets_Admin::submit('delete-snippets', __('Delete Selected', PostSnippets::TEXT_DOMAIN), 'button-secondary', false);
        echo '</form>';
Exemplo n.º 2
0
_snippet" class="large-text" style='width: 100%;' rows="5"><?php 
        echo htmlspecialchars($snippet['snippet'], ENT_NOQUOTES);
        ?>
</textarea>
            <?php 
        _e('Description', 'post-snippets');
        ?>
:
            <input type='text' style='width: 100%;' name='<?php 
        echo $key;
        ?>
_description' value='<?php 
        if (isset($snippet['description'])) {
            echo esc_html($snippet['description']);
        }
        ?>
' /><br/>
            </td>
            </tr>
        <?php 
    }
}
?>
        </tbody>
    </table>

<?php 
PostSnippets_Admin::submit('update-snippets', __('Update Snippets', 'post-snippets'));
PostSnippets_Admin::submit('add-snippet', __('Add New Snippet', 'post-snippets'), 'button-secondary', false);
PostSnippets_Admin::submit('delete-snippets', __('Delete Selected', 'post-snippets'), 'button-secondary', false);
echo '</form>';