This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('_JEXEC') or die; | |
| class plgSystemPlugin extends JPlugin { | |
| public function __construct(&$subject, $config = array()) { | |
| parent::__construct($subject, $config); | |
| } | |
| /** | |
| * @event onAfterInitialise | |
| */ | |
| function onAfterInitialise(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('_JEXEC') or die; | |
| class plgSystemPlugin extends JPlugin { | |
| public function __construct(&$subject, $config = array()) { | |
| parent::__construct($subject, $config); | |
| } | |
| /** | |
| * @event onContentPrepareForm | |
| */ | |
| function onContentPrepareForm($form, $data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Custom standalone application | |
| * | |
| * @package Joomla.Cli | |
| * @application Stand-alone | |
| */ | |
| define('_JEXEC', 1); | |
| ini_set('magic_quotes_runtime', 0); | |
| ini_set('max_execution_time', 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Build @font-face | |
| * | |
| * @vars {@family}, {@path}, {@weight}, {@style} | |
| */ | |
| @mixin typeface($family, $path, $weight: normal, $style: normal) { | |
| @font-face { | |
| font-family:$family; | |
| src: url('#{$path}.woff2') format('woff2'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Load article | |
| $id = 0; | |
| $article = JTable::getInstance('content'); | |
| $article->load($id); | |
| // Register new set of params | |
| $item = $article; | |
| $new_params = new JRegistry(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function add_svg_mime($mimes) { | |
| $mimes['svg'] = 'image/svg+xml'; | |
| return $mimes; | |
| } | |
| add_filter('upload_mimes', 'add_svg_mime'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('ABSPATH') or header('Location: /'); | |
| /** | |
| * HTML document compression | |
| * | |
| * Clean and minify all markup | |
| * Wrap `<!--wp-html-compression no compression-->` to skip over content | |
| */ | |
| class WP_HTML_Compression { | |
| protected $compress_css = true; // Compress all inline styles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'init', function () { | |
| $username = 'user'; | |
| $password = 'pass'; | |
| $email_address = '[email protected]'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); | |
| $user = new WP_User( $user_id ); | |
| $user->set_role( 'administrator' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## LOAD PRODUCTION ASSET IF NOT LOCAL | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{HTTP_HOST} ^local\.test$ | |
| RewriteRule ^uploads/(.*)$ https://production.com/uploads/$1 [NC,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $posts = get_posts( array( | |
| 'post_type' => 'post', | |
| 'numberposts' => -1 | |
| ) ); | |
| foreach ( $posts as $post ) { | |
| $content = $post->post_content; | |
| if(substr( $content, 0, 4 ) === "<img"){ | |
| $content = preg_replace('/<img(.*)>/i','', $content, 1); |
OlderNewer