Plugin Directory

Changeset 1299370


Ignore:
Timestamp:
12/02/2015 11:34:24 PM (10 years ago)
Author:
Brendanw7
Message:

Now includes the wordpress text editor instead of the generic html one.

Location:
admin-pages/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin-pages/trunk/bw-admin-pages.php

    r1299345 r1299370  
    22/*
    33 *  Plugin Name: Admin Pages
    4  *  Plugin URI: http://aftershockenterprises.com/
     4 *  Plugin URI: http://tech-centralhq.com/
    55 *  Description: Add pages to your admin area with ease
    6  *  Version: 1.0
     6 *  Version: 1.1
    77 *  Author: Brendan Wolfe
    8  *  Author URI: http://aftershockenterprises.com
     8 *  Author URI: http://tech-centralhq.com
    99 *  License: GPL2
    1010 *
     
    2222$plugin_url = WP_PLUGIN_URL . '/bw-admin-pages';
    2323$options = array();
     24/** In main plugin file **/
    2425
     26add_action('admin_print_scripts', 'do_jslibs' );
     27add_action('admin_print_styles', 'do_css' );
     28
     29function do_css()
     30{
     31    wp_enqueue_style('thickbox');
     32}
     33
     34function do_jslibs()
     35{
     36    wp_enqueue_script('editor');
     37    wp_enqueue_script('thickbox');
     38    wp_enqueue_script('media-upload');
     39    add_action( 'admin_head', 'wp_tiny_mce' );
     40}
     41function mynl2br($page_content) {
     42    //$page_content = nl2br($page_content);
     43    $page_content = htmlspecialchars_decode($page_content);
     44    $page_content = implode("",explode("\\",$page_content));
     45    $page_content = stripslashes(trim($page_content));
     46    return $page_content;
     47}
    2548/*
    2649* Add a link to plugin in the admin menu
     
    89112            $bwadminpages_id = esc_sql($_POST['bwadminpages_edit_page_id']);
    90113            $bwadminpages_page_title = esc_sql($_POST['bwadminpages_page_title']);
    91             $bwadminpages_page_content = esc_sql(htmlspecialchars($_POST['bwadminpages_page_content']));
     114            $bwadminpages_page_content = htmlspecialchars($_POST['bwadminpages_page_content']);
    92115            $bwadminpages_menu_position = esc_sql($_POST['bwadminpages_menu_position']);
    93116            $bwadminpages_menu_icon = esc_sql($_POST['bwadminpages_menu_icon']);
  • admin-pages/trunk/inc/add_pages.php

    r1299345 r1299370  
    66    if( $result ) {
    77         foreach( $result as $row ) {
    8              $page_title = esc_sql($row->page_title);
    9              $page_content= esc_sql($row->page_content);
    10              $menu_position = esc_sql($row->menu_position);
    11              $menu_icon = esc_sql($row->menu_icon);
    12              $menu_capability = esc_sql($row->menu_capability);
    13              $id = esc_sql($row->id);
     8             $page_title = $row->page_title;
     9             $page_content= $row->page_content;
     10             $menu_position = $row->menu_position;
     11             $menu_icon = $row->menu_icon;
     12             $menu_capability = $row->menu_capability;
     13             $id = $row->id;
    1414             $function_name = 'bwadminpages_'.$id;
    1515             $func = $function_name;
     
    2929                 }
    3030                 echo '<div class=\"wrap\">';
    31                  echo do_shortcode('".htmlspecialchars_decode(nl2br($page_content))."');
     31                 echo do_shortcode('".mynl2br($page_content)."');
    3232                 echo '</div>';
    3333                }"
  • admin-pages/trunk/inc/options-page-wrapper.php

    r1298680 r1299370  
    4545                                <br />
    4646                                <label for="bwadminpages_page_content">Page Content</label>
    47                                 <textarea name="bwadminpages_page_content" id="bwadminpages_page_content" type="text" rows="20" style="width: 95%;" class="regular-text"><?php echo $page_content; ?></textarea>
    48                                 <br />
     47                                <div id="poststuff">
     48                                <?php the_editor(mynl2br($page_content),'bwadminpages_page_content'); ?>
     49                                </div>
     50                                <!--<textarea name="bwadminpages_page_content" id="bwadminpages_page_content" type="text" rows="20" style="width: 95%;" class="regular-text"><?php echo mynl2br($page_content); ?></textarea>
     51                                <br />-->
    4952                                <br />
    5053                                <label for="bwadminpages_menu_position">Menu Position</label>
  • admin-pages/trunk/readme.txt

    r1298680 r1299370  
    55Requires at least: 4.3.1
    66Tested up to: 4.3.1
    7 Stable tag: 4.3.1
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.