jeudi 5 mai 2016

Wordpress custom plugin page redirect

develope plugin,but while I am click on admin menu work and admin page open but when I click in page anchor link its not working give error(attachement).

Code forntend :

<?php

/**
*Plugin Name: my name
*Plugin URI: url for ref
*Description: my desciop
*Version:1.0.0.0
*Author:xyz
**/



function ShareEmbed()
{
    global $current_user;   
    $user_ID = get_current_user_id();
    global $wpdb;
    $user_guid = $wpdb->get_results("SELECT wp_guid FROM wp_users where id=".$user_ID);
    print_r($user_guid); 


    ?>

    <div class="wrapper">   
    <div class="blog-embed">
        <span><h3>Code for share</h3></span>
        <textarea readonly=""><a href='example.com?bloggerrefid='><img src='http://ift.tt/1O1EO94' alt='logo' width='' border='0'></a></textarea>     
    </div>
    <div class="blog-embed-help">
        <h3>How to configure afflication program?</h3>
        <ul>
        <li><b>Step-1:</b>login into your blog/website account.</li>
        <li><b>Step-2:</b>copy above embed code</li>
        <li><b>Step-3:</b>Paste code into your site area as html block</li>
        <li><b>Step-4:</b>Save changes.</li>
        <li><b>Step-5:</b>That's it.We are done with this.Once any one click on this link it consider as a hit.</li>
        </ul>

    </div>
    </div>
    <?php
}

add_shortcode('shareblog','ShareEmbed');

/**
 * Register a custom menu page.
 */
function wpdocs_register_my_custom_menu_page() {
    add_menu_page(
        __( 'Custom Menu Title', 'textdomain' ),
        'ShareThis',
        'manage_options',
        'wp-blogger-share-this/wp-blogger-share-this-admin.php',
        '',
       'dashicons-networking', 6
       );
}
add_action( 'admin_menu', 'wpdocs_register_my_custom_menu_page' );

Admin file :

<?php
            global $wpdb;
            $current_guid=null;
            $user_guids = $wpdb->get_results("SELECT DISTINCT wp_guid FROM wp_blogger_data");
?><table border=1 width="100%">
            <tr><th width='30%'>User Name</th>  <th width='30%'>Total Hits</th> <th width='30%'>Unique Hits</th><TH>-</TH>?</tr>

            <?php

            foreach ($user_guids as $user_guid) {
                         $username_by_GUID = $wpdb->get_row("SELECT `user_login` FROM `users` where `wp_guid` = '$user_guid->wp_guid'");
                         $unique_hits = $wpdb->get_row("SELECT COUNT(DISTINCT `ip_address`) AS `unique_hits` FROM `tb1` where `wp_guid`='$user_guid->wp_guid'");
                         $total_hits = $wpdb->get_row("SELECT COUNT(`ip_address`) AS `total_hits` FROM `tb1` where `wp_guid` = '$user_guid->wp_guid'");
                        ?>
                        <tr><td><?php echo $username_by_GUID->user_login;?></td>
                        <?php
                        echo "<td>".$total_hits->total_hits."</td>";
                        echo "<td>".$unique_hits->unique_hits."</td>";  
                        ///wp-admin/admin.php?page=

wp-detail-view.php?id=wp_guid; ?> ">Delete ?>

Page here problem,I want to navigate on this page for details view.

wp-detail-view.php

<?php

echo "You are on Details view";

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire