Plugin Directory

Changeset 1854646


Ignore:
Timestamp:
04/07/2018 11:14:04 PM (8 years ago)
Author:
rich_
Message:

Tested on WP 4.9.5 and added new option

Location:
hot-corners/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • hot-corners/trunk/_hc-functions.php

    r1452179 r1854646  
    106106            <?php
    107107            break;
     108        case 'new_post' :
     109            ?>
     110            <li class="draggable" data-id="new_post">
     111                <span>New Post</span>
     112                <span class="drag-icon"></span>
     113            </li>
     114            <?php
     115            break;
    108116        case 'hcsettings' :
    109117            ?>
  • hot-corners/trunk/_hc-output.php

    r1452179 r1854646  
    11<?php
     2/**
     3 * All output to front end
     4 *
     5 *
     6 */
    27
    3 function wphc_hot_corners_main( ){
    4     global $post;
     8function wphc_hot_corners_main(){
     9  global $post;
     10 
     11  $current_user_id = get_current_user_id();
     12  $corners_enabled = false;
    513
    6     $current_user_id = get_current_user_id();
    7     $corners_enabled = false;
    8 
    9     if( !$current_user_id )
    10         return;
    11 
     14  if( !$current_user_id )
     15    return;
    1216
    1317    $user_data = get_userdata($current_user_id);
     
    5862    } else {
    5963        $edit_url = $admin_url . 'post.php?post=' . $id . '&action=edit';
    60     }
     64  }
     65 
     66  $new_post_link = $admin_url . "post-new.php";
    6167
    62     $edit_link = '<a href="'. $edit_url . '">edit</a>';
    63     $admin_link = '<a href="'.$admin_url.'">admin</a>';
    64     $cust_link = '<a href="'.$customizer_url.'">customizer</a>';
    65 
     68  $new_post_link = "<a href='$new_post_link'>New Post</a>";
     69    $edit_link = '<a href="'. $edit_url . '">Edit Post</a>';
     70    $admin_link = '<a href="'.$admin_url.'">Dashboard</a>';
     71    $cust_link = '<a href="'.$customizer_url.'">Customizer</a>';
     72 
    6673    $links = array(
    6774        'admin' => $admin_link,
    6875        'edit'  => $edit_link,
     76        'new_post'  => $new_post_link,
    6977        'customizer' => $cust_link,
    7078        'hcsettings' => '<a href="'.admin_url('options-general.php?page=wphc-settings.php').'">Hot Corners Settings</a>',
  • hot-corners/trunk/_hc-settings.php

    r1452179 r1854646  
    1919        <div class="wrap wphc-settings">
    2020            <div id="wphc-message-container"></div>
    21             <a target="_blank" class="beer" title="Buy me a beer." href="https://www.paypal.me/richardkeller" style="padding: 1em;position: absolute;top: 0;right: 0;"><img style="width:20px;" src="<?php echo plugin_dir_url( __FILE__ ) . '/assets/images/beercon.png' ?>" alt="Buy me a beer"></a>
     21            <a target="_blank" class="beer" title="Beer me!" href="https://www.paypal.me/richardkeller" style="padding: 1em;position: absolute;top: 0;right: 0;"><img style="width:20px;" src="<?php echo plugin_dir_url( __FILE__ ) . '/assets/images/beercon.png' ?>" alt="Buy me a beer"></a>
    2222           
    2323            <?php
     
    4747                    wphc_get_item('customizer');
    4848                    wphc_get_item('edit');
     49                    wphc_get_item('new_post');
    4950                    wphc_get_item('hcsettings');
    5051                    wphc_get_item('logout');
     
    5556
    5657        <?php $corners = get_option( 'wphc-corners'); ?>
    57 
    58         <!-- <pre id="dev-debug"> -->
    59             <?php
    60 
    61                 // print_r( $corners );
    62 
    63 
    64             ?>
    65         <!-- </pre> -->
    6658
    6759        <table class="wphc-table-corners">
  • hot-corners/trunk/readme.txt

    r1452182 r1854646  
    44Tags: toolbar
    55Requires at least: 3.0.1
    6 Tested up to: 4.4.2
    7 Stable tag: 4.4
     6Tested up to: 4.9.5
     7Stable tag: 4.9.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3131
    3232== Changelog ==
    33 
     330.1.1 - Added new post link option, tested with latest WordPress 4.9.5
    34340.1.0 - Added ability to activate corners by role.
    3535
Note: See TracChangeset for help on using the changeset viewer.