• Home
    • Payments
  • Tools
    • Color Chart
  • Software
    • Windows tricks
      • Windows 11 Speed Up Tricks
      • Windows Command Prompt CMD
    • Android Phone
      • Android – Dangerous Settings to Turn Off
    • Projects
      • Copy Files
      • Php Autoscript
      • Web Tools
  • Notes
    • How to Code
    • System Tips
  • News
    • Comparing SSD to HDD

How to Code

ACCESS 2022 | Browsers | Css | Htacess | Html | Html5 | Javascript | Microsoft Excel | Mysql | Mysql Dumps | Php | Vb.net | VBscript | Windows <=8 | Windows >=10 | WP | WP Plugin | WP Themes | _Misc Software |

ABCDEFGHIJKLMNOPQRSTUVWXYZ
ON
PRT
OFF

<- Look Inside Data
Conditions:
Order:
5 Language Operation Title
Keywords
Application
Code Languageid
Show Html
Show Iframe
Make Public
Viewed
Viewed Date
WP Plugin Customizing Putting Your Code Into Wordpress Admin
admin embed iframe
Developer Wordpress
Got it — you want to embed an iFrame inside the WordPress admin area (not just in posts or pages). This is a bit different from front-end embedding because it involves customizing the WordPress dashboard or admin pages.

Here’s how you can do it safely and cleanly:

1. Add an iFrame to a Custom Admin Page
You can create a new admin menu item and load your iFrame inside it.

Php
Copy code
// Add this to your theme's functions.php or a custom plugin
function my_custom_admin_page() {
add_menu_page(
'My iFrame Page', // Page title
'iFrame Page', // Menu title
'manage_options', // Capability
'my-iframe-page', // Menu slug
'my_iframe_page_html', // Callback function
'dashicons-admin-site', // Icon
20 // Position
);
}
add_action('admin_menu', 'my_custom_admin_page');

function my_iframe_page_html() {
?>
{div class="wrap">
{h1>Embedded iFrame{/h1>
{iframe src="https://example.com" width="100%" height="600" style="border:0;">{/iframe>
{/div>
{?php
}
2. Embed iFrame in an Existing Admin Page via Hook
If you want to insert it into an existing settings page, you can hook into the page’s output:

Php
Copy code
function my_iframe_in_settings_page() {
echo '{iframe src="https://example.com" width="100%" height="500" style="border:0;">{/iframe>';
}
add_action('admin_notices', 'my_iframe_in_settings_page');
(Note: This will show at the top of all admin pages — you can conditionally check $_GET['page'] to target specific ones.)

3. Use a Dashboard Widget with iFrame
This is great if you want the iFrame right on the WordPress Dashboard.

Php
Copy code
function my_iframe_dashboard_widget() {
wp_add_dashboard_widget(
'my_iframe_widget',
'My iFrame Widget',
function() {
echo '{iframe src="https://example.com" width="100%" height="400" style="border:0;">{/iframe>';
}
);
}
add_action('wp_dashboard_setup', 'my_iframe_dashboard_widget');
???? Tips for Safety & Compatibility

Only embed trusted URLs to avoid security risks.
Some sites block embedding via X-Frame-Options. If your iFrame doesn’t load, that’s likely the reason.
For better styling, you can enqueue custom CSS for admin pages using admin_enqueue_scripts.
If you want, I can make a version where the iFrame is responsive and styled to match the WordPress admin UI so it feels native. Would you like me to prepare that?

Undo



?php
/*
Plugin Name: Custom Admin PHP Script
Description: Adds a custom admin page that runs a PHP script.
Version: 1.0
Author: Your Name
*/

// Hook into admin menu
add_action('admin_menu', 'cap_add_admin_page');

function cap_add_admin_page() {
add_menu_page(
'Custom PHP Script', // Page title
'Custom Script', // Menu title
'manage_options', // Capability
'custom-php-script', // Menu slug
'cap_render_admin_page', // Callback function
'dashicons-editor-code', // Icon
100 // Position
);
}

// Render the admin page
function cap_render_admin_page() {
if (!current_user_can('manage_options')) {
wp_die('Unauthorized user');
}

echo '{div class="wrap">{h1>Custom PHP Script Output{/h1>';

// Your PHP script logic here
try {
$result = date('Y-m-d H:i:s'); // Example: current date/time
echo "{p>Server time is: {strong>{$result}{/strong>{/p>";
} catch (Exception $e) {
echo '{p style="color:red;">Error: ' . esc_html($e->getMessage()) . '{/p>';
}

echo '{/div>';
}
WP Plugin



0
01/19/2026
WP Plugin Formatting Making Your Shortcode Report Look Good In WP
style.css shortcode report plugin
Shortcode

Add this to your WP custom css


body {overflow:visible;}
table{border-color:black;border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt}
textarea{ font-size:8pt; }
hr.cell_split{color:red;}
tr.alt{background-color:#EEEEEE;}
td{font-family:verdana;font-size:8pt;border:1px solid #000000;}
.navletters {margin:0 7px 0 7px; }
td.code_mod {max-width: 600px;}
div.scroll{overflow:auto;text-align:left;min-width:200px;max-width:600px;max-height:200px; }
input[type="button"],input[type="submit"]{
background-color: #64c9ea;
border: none;
border-radius: 2px;
box-shadow: none;
color: #fff;
cursor: pointer;
padding: 5px 5px;
min-width:10px;margin:5px;}
input[type="text"],input[type="select"] {font-family:verdana;font-size:10pt;margin:5px;padding: 2px 2px;width:70%}
WP Plugin



5
09/09/2023
WP Plugin Plug-in Link Your Admin Inside Of Wordpress Admin
plug-in plug in admin panel link admin
Custom
WP Plugin



725
09/09/2023
WP Plugin Plug-in Shortcode Examples (Keep Colorado Free)
shortcode wordpress admin plugin membership form attribute
Custom
When a user writes a shortcode:

[my_shortcode att1="Attribute 1 value" att2="Attribute 2 value"]

The attributes are passed to the shortcode's callback function as an array as the first argument:

function my_shortcode_callback( $atts ) {
// $atts = array(
// 'att1' => 'Attribute 1 value',
// 'att2' => 'Attribute 2 value',
// );
}
add_shortcode( 'my_shortcode', 'my_shortcode_callback' );

The function shortcode_atts():

Combine user attributes with known attributes and fill in defaults when needed.

So you use shortcode_atts() to create an array with default values all supported attributes, except for any that were provided by the user. To do this you pass an array of all supported attributes and their defaults as the first argument, and the user-provided attributes as the second argument. The second argument will therefore be the same array that is passed to the callback function:

function my_shortcode_callback( $user_atts ) {
// $user_atts = array(
// 'att1' => 'Attribute 1 value',
// 'att2' => 'Attribute 2 value',
// );

$default_atts = array(
'att1' => 'Attribute 1 default',
'att2' => 'Attribute 2 default',
'att3' => 'Attribute 3 default',
);

$atts = shortcode_atts( $default_atts, $user_atts, 'my_shortcode' );

// $atts = array(
// 'att1' => 'Attribute 1 value',
// 'att2' => 'Attribute 2 value',
// 'att3' => 'Attribute 3 default',
// );
}
add_shortcode( 'my_shortcode', 'my_shortcode_callback' );

You do this so that you can do things like use $atts['att3'] without causing a PHP error if the user did not enter att3="Attribute 3 value" when placing the shortcode.

The 3rd argument of shorcode_atts() should be set to the shortcode name. This makes it possible to filter the shortcode attributes like this:

add_filter(
'shortcode_atts_my_shortcode',
function( $atts ) {
$atts['atts2'] = 'Attribute 2 override';

return $atts;
}
);




To create a WordPress shortcode with attributes, you need to define a PHP function that accepts an
$atts parameter and use the shortcode_atts() function to parse and manage the attributes.
1. Define the Callback Function
The shortcode handler function accepts three optional parameters:

$atts: An associative array of attributes provided by the user in the post content.
$content: The content enclosed between the opening and closing tags (for enclosing shortcodes).
$tag: The shortcode tag name itself.

The shortcode_atts() helper function merges the user-provided attributes with a set of default values, ensuring all defined attributes exist in the resulting array and unsupported ones are ignored.
function custom_button_shortcode( $atts, $content = null, $tag = '' ) {
// Define default attributes and merge with user-provided attributes
$a = shortcode_atts(
array(
'class' => 'button', // Default class
'href' => '#', // Default URL
'color' => 'blue', // Default color
),
$atts,
'custom_button' // The shortcode name (tag) for filtering
);

// Sanitize and use the attributes
$class = esc_attr( $a['class'] );
$href = esc_url( $a['href'] );
$color = esc_attr( $a['color'] );
$content = sanitize_text_field( $content );

// Return the HTML output
return '' . $content . '';
}

2. Register the Shortcode
Use the add_shortcode() function to register your handler function with a specific shortcode tag. This code is typically placed in your theme's functions.php file or a custom plugin file.

add_shortcode( 'custom_button', 'custom_button_shortcode' );

3. Use the Shortcode in WordPress
You can now use the shortcode in your post or page content with or without attributes.

With attributes:
[custom_button href="https://example.com" color="red" class="my-btn"]Visit Example[/custom_button]
Without attributes (uses defaults):
[custom_button]Learn More[/custom_button]
Self-closing form (if $content is optional):
[custom_button href="https://example.com" /]

Key Points
Return, Don't Echo: Shortcode functions must return their output as a string, not echo it directly.
Attribute Names: Attribute names are converted to lowercase automatically. Use lowercase and underscores for best compatibility.
Security: Always sanitize user input (attributes and content) using functions like esc_attr(), esc_url(), or sanitize_text_field() before outputting to prevent security vulnerabilities.
Spacing: A space is required between the shortcode name and its first attribute, and between each attribute.



/*
* Plugin Name: Members Only
* Description: Use short code to check for priveleges and creates Admin access.
* Version: 1.0
* Author: Software Web Design
* Author URI: https://softwarewebdesign.com
*/


$appid="777";
if ( ! defined( 'SWD_PATH' ) ) {
define( 'SWD_PATH', plugin_dir_path( __FILE__ ) );
}
require_once( SWD_PATH."SWD/WPfunctions.php");
$connection=$wpdb->dbh;
function MemberCheck($atts){
global $wpdb; global $appid;global $connection;
//print_r ($atts);exit;
$dis= $_COOKIE["Member"];
//if($dis!="true"){ header("Location:https://www.keepcofree.com/member-login/");exit; }
if(substr($dis,0,4)!="true" || $dis=="true"){
?>^script language="javascript">location.href="https://www.keepcofree.com/member-login/" } else{
//?echo "shoot9".$dis;
$L1=strlen($dis); $dis=substr($dis,4,$L1-4);
//echo "shoot".$dis; exit;
$individualid=(int)$dis;
$r=new mysqli_swd();
$sql="SELECT * FROM individual WHERE individualid = $individualid";$r->dbsql($sql);
if($atts["level"]==1)return;
if($atts["level"]==2 && $r->data1["paid"]==0){ ?>^script language="javascript">location.href="https://www.keepcofree.com/member-login/" //echo "shoot=".$individual;exit;
}

return;
}

//include( plugins_url()."/Membersonly/SWD/WPfunctions.php");
add_shortcode("Members-Only", "MemberCheck");

function my_admin_menu() {
add_menu_page(__( 'Godzilla', 'my-textdomain' ),__( 'SWD Members', 'my-textdomain' ),'manage_options','sample-page','SWD_admin_page_contents','dashicons-schedule',10);
}
add_action( 'admin_menu', 'my_admin_menu' );
function SWD_admin_page_contents() {
?>




}
function register_my_plugin_scripts() {
wp_register_style( 'my-plugin', plugins_url( 'ddd/css/plugin.css' ) );
wp_register_script( 'my-plugin', plugins_url( 'ddd/js/plugin.js' ) );
}
// add_action( 'admin_enqueue_scripts', 'register_my_plugin_scripts' );
function load_my_plugin_scripts( $hook ) {
// Load only on ?page=sample-page
if( $hook != 'toplevel_page_sample-page' ) {
return;
}
// Load style & scripts.
wp_enqueue_style( 'my-plugin' );
wp_enqueue_script( 'my-plugin' );
}
add_action( 'admin_enqueue_scripts', 'load_my_plugin_scripts' );

//END ADMIN

?>
WP Plugin



3
12/22/2022
WP Plugin Plug-in Scriptures
show table of records
Custom
WP Plugin



1
12/22/2022

Software Web Design