$83 GRAYBYTE WORDPRESS FILE MANAGER $75

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.ancuong.com/wp-content/plugins/my-permalink-button/

HOME
Current File : /home/bqrcodec/contact.ancuong.com/wp-content/plugins/my-permalink-button//my-permalink-button.php
<?php
/*
Plugin Name: My Permalink Button
Description: Adds a button shortcode to copy the current post permalink.
*/

// Register the shortcode
function my_permalink_button_shortcode() {
    // Get the current post's permalink
    $permalink = get_permalink();

    // Add the button HTML
    $button_html = '<button onclick="copyToClipboard(this)" data-permalink="' . esc_attr($permalink) . '">' . esc_html__('Sao Chép Link Hồ Sơ') . '</button>';

    // Add the JavaScript function to copy to clipboard
    $js_code = '<script>
    function copyToClipboard(button) {
        const permalink = button.getAttribute("data-permalink");

        const textArea = document.createElement("textarea");
        textArea.value = permalink;
        document.body.appendChild(textArea);
        textArea.select();
        document.execCommand("copy");
        document.body.removeChild(textArea);
        alert("Copied link hồ sơ to clipboard!");
    }
    </script>';

    // Return the button and JavaScript code
    return $button_html . $js_code;
}
add_shortcode('my_permalink_button', 'my_permalink_button_shortcode');

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
19 Mar 2026 3.00 PM
bqrcodec / bqrcodec
0755
my-permalink-button.php
1.095 KB
26 Jan 2024 11.55 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF