A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
| <?php // only copy this line if needed! | |
| // REQUIRES PHP 5.3+ | |
| /** | |
| * Create a shortcode to insert a header with an anchor icon. | |
| * Use [heading size="2" id="anchor"]Heading[/heading] | |
| * | |
| * Recommended: Add prefix / change shortcode name to avoid conflicts | |
| */ |
| <?php | |
| // The ID of the lists you want to add a user to | |
| $list_ids = array( 1 ); | |
| // User Data without the custom fields | |
| $data_subscriber = array( | |
| 'user' => array( | |
| 'email' => 'johndoe@email.com', | |
| 'firstname' => 'John', | |
| 'lastname' => 'Doe', |
| function third_party_tab( $tabs ) { | |
| global $product; | |
| $some_check = $product ? third_party_check( $product->id ) : null; | |
| if ( $product && ! $some_check ) { | |
| return $tabs; | |
| } | |
| $tabs['third_party_tab'] = array( |
| Taken from:https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86) | |
| https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86) | |
| only pasted here so I can be sure I will always have it. | |
| NB: do this ALTERNATIVE INSTEAD(it solves multi reboots on vagrant up) | |
| 1. build kernel headers as per this diff method: https://github.com/divx118/crouton-packages/blob/master/README.md | |
| ie: from a shell in ua chroot(ubuntu) | |
| $ cd ~ | |
| $ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh |
| <?php | |
| class My_Plugin_Options { | |
| var $options; | |
| var $option_name; | |
| var $is_site_option; // Are we using Multisite and saving to global options? | |
| function My_Plugin_Options($option_name, $is_site_options = false){ | |
| $this->option_name = $option_name; | |
| $this->is_site_option = $is_site_options; | |
| if($this->is_site_option){ |
| //* Register widget areas | |
| genesis_register_sidebar( array( | |
| 'id' => 'parallax-section-below-header', | |
| 'name' => __( 'Parallax Section Below Header', 'your-theme-slug' ), | |
| 'description' => __( 'This is the parallax section below header.', 'your-theme-slug' ), | |
| ) ); | |
| genesis_register_sidebar( array( | |
| 'id' => 'parallax-section-above-footer', | |
| 'name' => __( 'Parallax Section Above Footer', 'your-theme-slug' ), |
| <?php | |
| /* | |
| * Plugin Name: Paulund WP List Table Example | |
| * Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area | |
| * Plugin URI: http://www.paulund.co.uk | |
| * Author: Paul Underwood | |
| * Author URI: http://www.paulund.co.uk | |
| * Version: 1.0 | |
| * License: GPL2 | |
| */ |
| <!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ --> | |
| <style type="text/css"> | |
| .no-fouc {display: none;} | |
| </style> | |
| <script type="text/javascript"> | |
| document.documentElement.className = 'no-fouc'; | |
| // add to document ready: $('.no-fouc').removeClass('no-fouc'); | |
| </script> |