Plugin Directory

Changeset 2355304


Ignore:
Timestamp:
08/08/2020 06:00:26 PM (6 years ago)
Author:
zeshanb
Message:

update to version 1.1
fixed undefined index bugs
tested with most recent stable wordpress

Location:
wp-post-html-to-blocks
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • wp-post-html-to-blocks/trunk/readme.txt

    r2037422 r2355304  
    33Tags: html tags, surround, Gutenberg , html block
    44Requires at least: 5.0
    5 Tested up to: 5.1
     5Tested up to: 5.4.2
    66Requires PHP: 7.0
    7 Stable tag: 1.0.1
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3939* added default dashbaord styles to table and search form
    4040
     41= 1.1 =
     42* Fixed undefined index bugs
     43* new screenshots for readme
     44
    4145== Frequently Asked Questions ==
    4246 
     
    5256
    5357You have a choice to select the post with status you prefer.
     58
    5459 
    5560== Screenshots ==
    5661
    57 1. For example converts these paragraph tags. (next image)
    58 2. ..into html blocks for use by Gutenberg editor.
    59 3. Selected post is already processed.
     621. Suppose you have a Wordpress post with paragraph lines from a classic editor
     632. Using this plugin you search for post title select paragraph tags and press encapsulate html tags
     643. This plugin converts html tags into html blocks in Gutenberg editor.
    60654. Location of plugin's configuration page.
    61665. Configuration page selecting a tag for searching through.
  • wp-post-html-to-blocks/trunk/wp-post-html-to-blocks.php

    r2014495 r2355304  
    44Plugin URI: http://www.zdatatech.com/plugins/wp-post-html-to-blocks
    55Description: Admin options to surround line space, p tag, and div tag content with html Gutenberg Blocks
    6 Version: 1.0
     6Version: 1.1
    77Author: Zeshan
    88Author URI: http://zdatatech.com/about
     
    1212*/
    1313
     14//stackoverflow undefined index https://stackoverflow.com/questions/4842759/php-undefined-index
     15
    1416if(is_admin()){
    1517
    16    
    1718    /*Add Menu option for Admin*/
    1819    add_action('admin_menu', 'wp_post_html_to_blocks_menu');
     
    246247       global $wpdb;
    247248     
    248      $RequestSent = sanitize_text_field($_POST['RequestSent']);
    249         $topPosts = sanitize_text_field($_POST['topPosts']);
    250      $SearchPosts = sanitize_text_field($_POST['SearchPosts']);
    251      $queryPostID = sanitize_text_field($_POST['queryPostID']);
    252  $queryPostStatus = sanitize_text_field($_POST['queryPostStatus']);
    253  $htmlSurroundTag = sanitize_text_field($_POST['htmlSurroundTag']);
     249        $PostsQuery = (isset($PostsQuery) ? $PostsQuery : null);
     250        $RequestSent = sanitize_text_field((isset($_POST['RequestSent']) ? $_POST['RequestSent'] : null));
     251        $topPosts = sanitize_text_field((isset($_POST['topPosts']) ? $_POST['topPosts'] : 1));
     252        $queryPostID = sanitize_text_field((isset($_POST['queryPostID']) ? $_POST['queryPostID'] : null));
     253        $queryPostStatus = sanitize_text_field((isset($_POST['queryPostStatus']) ? $_POST['queryPostStatus'] : null));
     254        $htmlSurroundTag = sanitize_text_field((isset($_POST['htmlSurroundTag']) ? $_POST['htmlSurroundTag'] : null));
     255        $SearchPosts = sanitize_text_field((isset($_POST['SearchPosts']) ? $_POST['SearchPosts'] : null));
    254256     
    255257    //if run query button pressed..to prevent performance tax on a wordpress install
     
    277279   
    278280
    279 ?>     
     281?> 
     282
     283   <div class="welcome-panel" id="welcome-panel"    >
    280284    <h2>About WP Post HTML to Blocks</h2>
    281285   
    282     <p>For content that is copy pasted into Gutenberg editor classic block. Purpose of this plugin is to allow a Wordpress publisher administrator to manually surround html tags such as p, div, br for interpretation by Gutenberg editor as html blocks.</p>
     286    <p>For content that is copy pasted into <strong>Gutenberg editor classic block</strong>. Purpose of this plugin is to allow a <strong>Wordpress publisher administrator</strong> to manually <strong>surround html tags</strong> such as p, div, br <strong>for interpretation</strong> by Gutenberg editor <strong>as html blocks.</strong></p>
    283287   
    284288    <?php
     
    330334     
    331335        <form target="_self" method="post">
    332           <label> Search Title Field of Posts </label><input type="text" name="SearchPosts" value="<?php if($SearchPosts){echo $SearchPosts;} ?>" />
     336          <div class="media-toolbar-primary search-form">
     337         
     338          <label> Search</label>
     339            <input type="search" name="SearchPosts"  placeholder="Terms from Post Titles"  value="<?php if(isset($SearchPosts)){echo $SearchPosts;} ?>"/>
    333340          <label> Top</label>
    334           <select name="topPosts"
     341          <select name="topPosts" id="bulk-action-selector-bottom" class="postform">   
    335342            <option value="1" selected=selected>1</option>
    336343            <option value="5" >5</option>
     
    340347            <option value="30" >30</option>
    341348          </select>
    342              <button>Search</button>
     349             <button class="button media-button"  >Search</button>
    343350                  <input type="hidden" name="RequestSent" value="RequestingPosts" />
    344          
     351               
     352           </div>
    345353         </form> 
    346354         <?php
     
    348356          ?>         
    349357         
    350           <table style="border-style:solid;border-width:2px;width:70%;">
     358          <table class="wp-list-table widefat fixed striped posts">
     359           <thead>
    351360             <tr >
    352                  <th style="border-style:solid;border-width:2px;"> ID</th>
    353                  <th style="border-style:solid;border-width:2px;">Title</th>
    354                  <th style="border-style:solid;border-width:2px;">Status</th>
    355                  <th style="border-style:solid;border-width:2px;">Seek HTML Tag</th>
    356                  <th style="border-style:solid;border-width:2px;">Surround HTML Tags with Blocks</th>
     361                 <th> ID</th>
     362                 <th >Title</th>
     363                 <th >Status</th>
     364                 <th >Seek HTML Tag</th>
     365                 <th>Surround HTML Tags with Blocks</th>
    357366             </tr>
    358            
     367            </thead>
     368            <tbody>
    359369             <?php
    360370                foreach($PostsQuery as $QuriedPosts){
     
    363373              <tr>
    364374               <form target="_self" method="post">
    365                   <td style="border-style:solid;border-width:2px;"><?php echo $QuriedPosts->ID ?></td>
    366                   <td style="border-style:solid;border-width:2px;"><?php echo $QuriedPosts->post_title ?></td>
    367                   <td style="border-style:solid;border-width:2px;"><strong><?php echo $QuriedPosts->post_status ?></strong></td>
    368                   <td style="border-style:solid;border-width:2px;">
    369                     <select name="htmlSurroundTag">
     375                  <td ><?php echo $QuriedPosts->ID ?></td>
     376                  <td ><?php echo $QuriedPosts->post_title ?></td>
     377                  <td ><strong><?php echo $QuriedPosts->post_status ?></strong></td>
     378                  <td >
     379                    <select name="htmlSurroundTag" id="bulk-action-selector-top">
    370380                        <option value="LineSpace">Lines With Space (\n)</option>
    371381                        <option value="p" selected=selected>&lt;p&gt;&lt;/p&gt;</option>
     
    374384                     </select>
    375385                  </td>
    376                   <td style="border-style:solid;border-width:2px;">
    377                    <button>Encapsulate HTML tag</button>
     386                  <td>
     387                   <button class="button action">Encapsulate HTML tag</button>
    378388                  <input type="hidden" name="queryPostID" value="<?php echo $QuriedPosts->ID ?>" />
    379389                  <input type="hidden" name="queryPostStatus" value="<?php echo $QuriedPosts->post_status ?>" /> 
     
    381391                </form>
    382392              </tr> 
    383                
     393            </tbody>   
    384394            <?php
    385395                } //close foreach
    386396           
    387397            ?>
    388            
    389 
     398            <tfoot>
     399             <tr >
     400                 <th>ID</th>
     401                 <th>Title</th>
     402                 <th>Status</th>
     403                 <th>Seek HTML Tag</th>
     404                 <th>Surround HTML Tags with Blocks</th>
     405             </tr>
     406            </tfoot>
    390407          </table>
    391408         
     
    396413   
    397414    </div>
    398    
     415 </div><!-- close welcome-panel -->
    399416
    400417<?php
Note: See TracChangeset for help on using the changeset viewer.