Changeset 2563923
- Timestamp:
- 07/13/2021 11:10:45 PM (4 years ago)
- Location:
- lorem-ipsum-replace-content
- Files:
-
- 4 added
- 4 edited
- 1 copied
-
tags/0.4 (copied) (copied from lorem-ipsum-replace-content/trunk)
-
tags/0.4/LICENSE (added)
-
tags/0.4/README.md (added)
-
tags/0.4/lorem-ipsum-replace-content.php (modified) (4 diffs)
-
tags/0.4/readme.txt (modified) (4 diffs)
-
trunk/LICENSE (added)
-
trunk/README.md (added)
-
trunk/lorem-ipsum-replace-content.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lorem-ipsum-replace-content/tags/0.4/lorem-ipsum-replace-content.php
r1225083 r2563923 1 1 <?php 2 /** 3 * Plugin Name: Lorem Ipsum Replace Content 4 * Plugin URI: https://github.com/circlecube/lorem-ipsum-replace-content 5 * Description: Render your content with lorem ipsum, word for word. 6 * Version: 0.4 7 * Requires at least: 5.2 8 * Requires PHP: 7.2 9 * Author: Evan Mullins 10 * Author URI: https://circlecube.com 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 */ 14 2 15 /* 3 Plugin Name: Lorem Ipsum Replace Content4 Plugin URI: http://circlecube.com5 Description: Replace your content with lorem ipsum, word for word.6 Version: 0.37 Author: Evan Mullins8 Author Email: [email protected]9 License: GPLv2 or later10 16 11 Copyright 20 11 Evan Mullins ([email protected])17 Copyright 2021 Evan Mullins ([email protected]) 12 18 13 19 This program is free software; you can redistribute it and/or modify … … 28 34 class LoremIpsumReplaceContent { 29 35 30 /*--------------------------------------------*31 * Constants32 *--------------------------------------------*/33 const name = 'Lorem Ipsum Replace Content';34 const slug = 'lorem_ipsum_replace_content';35 36 36 /** 37 37 * Constructor 38 38 */ 39 39 function __construct() { 40 //register an activation hook for the plugin41 register_activation_hook( __FILE__, array( &$this, 'install_lorem_ipsum_replace_content' ) );42 43 40 //Hook up to the init action 44 41 add_action( 'init', array( &$this, 'init_lorem_ipsum_replace_content' ) ); 45 }46 47 /**48 * Runs when the plugin is activated49 */50 function install_lorem_ipsum_replace_content() {51 // do not generate any output here52 42 } 53 43 … … 56 46 */ 57 47 function init_lorem_ipsum_replace_content() { 58 // Load JavaScript and stylesheets59 $this->register_scripts_and_styles();60 61 62 if ( is_admin() ) {63 //this will run when in the WordPress admin64 } else {65 //this will run when on the frontend66 }67 68 /*69 * TODO: Define custom functionality for your plugin here70 *71 * For more information:72 * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters73 */74 // add_action( 'your_action_here', array( &$this, 'action_callback_method_name' ) );75 48 add_filter( 'the_content', array( &$this, 'lorem_ipsumize_the_content' ) ); 76 }77 78 function action_callback_method_name() {79 // TODO define your action method here80 }81 82 function filter_callback_method_name() {83 // TODO define your filter method here84 49 } 85 50 … … 138 103 } 139 104 140 /**141 * Registers and enqueues stylesheets for the administration panel and the142 * public facing site.143 */144 private function register_scripts_and_styles() {145 if ( is_admin() ) {146 147 } else {148 149 } // end if/else150 } // end register_scripts_and_styles151 152 /**153 * Helper function for registering and enqueueing scripts and styles.154 *155 * @name The ID to register with WordPress156 * @file_path The path to the actual file157 * @is_script Optional argument for if the incoming file_path is a JavaScript source file.158 */159 private function load_file( $name, $file_path, $is_script = false ) {160 161 $url = plugins_url($file_path, __FILE__);162 $file = plugin_dir_path(__FILE__) . $file_path;163 164 if( file_exists( $file ) ) {165 if( $is_script ) {166 wp_register_script( $name, $url, array('jquery') ); //depends on jquery167 wp_enqueue_script( $name );168 } else {169 wp_register_style( $name, $url );170 wp_enqueue_style( $name );171 } // end if172 } // end if173 174 } // end load_file175 176 105 } // end class 177 106 new LoremIpsumReplaceContent(); -
lorem-ipsum-replace-content/tags/0.4/readme.txt
r1225083 r2563923 4 4 Tags: lorem ipsum 5 5 Requires at least: 3 6 Tested up to: 4.37 Stable tag: 0. 36 Tested up to: 5.8 7 Stable tag: 0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 You created a site and want to show it off, but the client does not want their copy used. Just install this plugin and every word in their posts will be swapped out for beautimus latin. 18 18 19 Note: This does not replace content in the front end. It created a filter that replaces content on the front end of the site only. 20 19 21 == Installation == 20 22 … … 25 27 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory 26 28 1. Activate the plugin through the 'Plugins' menu in WordPress 27 1. Read lorem ipsum29 1. See site content replaced with lorem ipsum on the front end. 28 30 29 31 == Frequently Asked Questions == … … 39 41 == Changelog == 40 42 43 = 0.4 = 44 Update latest testing version. 45 41 46 = 0.3 = 42 47 Update to avoid replacing shortcodes. -
lorem-ipsum-replace-content/trunk/lorem-ipsum-replace-content.php
r1225083 r2563923 1 1 <?php 2 /** 3 * Plugin Name: Lorem Ipsum Replace Content 4 * Plugin URI: https://github.com/circlecube/lorem-ipsum-replace-content 5 * Description: Render your content with lorem ipsum, word for word. 6 * Version: 0.4 7 * Requires at least: 5.2 8 * Requires PHP: 7.2 9 * Author: Evan Mullins 10 * Author URI: https://circlecube.com 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 */ 14 2 15 /* 3 Plugin Name: Lorem Ipsum Replace Content4 Plugin URI: http://circlecube.com5 Description: Replace your content with lorem ipsum, word for word.6 Version: 0.37 Author: Evan Mullins8 Author Email: [email protected]9 License: GPLv2 or later10 16 11 Copyright 20 11 Evan Mullins ([email protected])17 Copyright 2021 Evan Mullins ([email protected]) 12 18 13 19 This program is free software; you can redistribute it and/or modify … … 28 34 class LoremIpsumReplaceContent { 29 35 30 /*--------------------------------------------*31 * Constants32 *--------------------------------------------*/33 const name = 'Lorem Ipsum Replace Content';34 const slug = 'lorem_ipsum_replace_content';35 36 36 /** 37 37 * Constructor 38 38 */ 39 39 function __construct() { 40 //register an activation hook for the plugin41 register_activation_hook( __FILE__, array( &$this, 'install_lorem_ipsum_replace_content' ) );42 43 40 //Hook up to the init action 44 41 add_action( 'init', array( &$this, 'init_lorem_ipsum_replace_content' ) ); 45 }46 47 /**48 * Runs when the plugin is activated49 */50 function install_lorem_ipsum_replace_content() {51 // do not generate any output here52 42 } 53 43 … … 56 46 */ 57 47 function init_lorem_ipsum_replace_content() { 58 // Load JavaScript and stylesheets59 $this->register_scripts_and_styles();60 61 62 if ( is_admin() ) {63 //this will run when in the WordPress admin64 } else {65 //this will run when on the frontend66 }67 68 /*69 * TODO: Define custom functionality for your plugin here70 *71 * For more information:72 * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters73 */74 // add_action( 'your_action_here', array( &$this, 'action_callback_method_name' ) );75 48 add_filter( 'the_content', array( &$this, 'lorem_ipsumize_the_content' ) ); 76 }77 78 function action_callback_method_name() {79 // TODO define your action method here80 }81 82 function filter_callback_method_name() {83 // TODO define your filter method here84 49 } 85 50 … … 138 103 } 139 104 140 /**141 * Registers and enqueues stylesheets for the administration panel and the142 * public facing site.143 */144 private function register_scripts_and_styles() {145 if ( is_admin() ) {146 147 } else {148 149 } // end if/else150 } // end register_scripts_and_styles151 152 /**153 * Helper function for registering and enqueueing scripts and styles.154 *155 * @name The ID to register with WordPress156 * @file_path The path to the actual file157 * @is_script Optional argument for if the incoming file_path is a JavaScript source file.158 */159 private function load_file( $name, $file_path, $is_script = false ) {160 161 $url = plugins_url($file_path, __FILE__);162 $file = plugin_dir_path(__FILE__) . $file_path;163 164 if( file_exists( $file ) ) {165 if( $is_script ) {166 wp_register_script( $name, $url, array('jquery') ); //depends on jquery167 wp_enqueue_script( $name );168 } else {169 wp_register_style( $name, $url );170 wp_enqueue_style( $name );171 } // end if172 } // end if173 174 } // end load_file175 176 105 } // end class 177 106 new LoremIpsumReplaceContent(); -
lorem-ipsum-replace-content/trunk/readme.txt
r1225083 r2563923 4 4 Tags: lorem ipsum 5 5 Requires at least: 3 6 Tested up to: 4.37 Stable tag: 0. 36 Tested up to: 5.8 7 Stable tag: 0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 You created a site and want to show it off, but the client does not want their copy used. Just install this plugin and every word in their posts will be swapped out for beautimus latin. 18 18 19 Note: This does not replace content in the front end. It created a filter that replaces content on the front end of the site only. 20 19 21 == Installation == 20 22 … … 25 27 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory 26 28 1. Activate the plugin through the 'Plugins' menu in WordPress 27 1. Read lorem ipsum29 1. See site content replaced with lorem ipsum on the front end. 28 30 29 31 == Frequently Asked Questions == … … 39 41 == Changelog == 40 42 43 = 0.4 = 44 Update latest testing version. 45 41 46 = 0.3 = 42 47 Update to avoid replacing shortcodes.
Note: See TracChangeset
for help on using the changeset viewer.