- Table of contents
- General information
- Terms
- General structure of a test
- WordPress-specific assertions and test functions
- enqueues
- creating posts
- creating terms
- attaching images
- ?
| /** | |
| * The layout of a WP List Table typically changes from a multi-column to | |
| * single-column layout when the viewport width is less than or equal to 782px. | |
| * This CSS shifts that breakpoint to 960px for tables with more columns that | |
| * would otherwise become squished if they were all crammed on screen at once. | |
| */ | |
| @media screen and ( max-width: 960px ) { | |
| /* WP List Table Options & Filters */ | |
| .tablenav { |
| # This makes sure Chrome is always up to date in your test suite | |
| # On average this adds about 10 seconds to your build suite | |
| # Be sure to use Ubuntu 14.04 (Trusty) in the CircleCI's OS setting (Settings > Build Environment) | |
| dependencies: | |
| pre: | |
| - curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| - sudo dpkg -i google-chrome.deb | |
| - sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome | |
| - rm google-chrome.deb |
| <?php | |
| /* | |
| * Add a new custom tag to the 'pre defined tags' section | |
| * @ Change 'tag', 'description' and 'title' to suit your needs. | |
| * @ $available_tags - the default pre-defined tags available out of the box | |
| */ | |
| add_filter( 'yikes-mailchimp-custom-default-value-tags', 'add_new_pre_defined_tags' ); | |
| function add_new_pre_defined_tags( $available_tags ) { | |
| // define a new array, with our default tag data (note: to create more than one, simply copy and paste what is below and alter the values) | |
| $available_tags[] = array( |
| <? | |
| /** | |
| * Truncates text. | |
| * | |
| * Cuts a string to the length of $length and replaces the last characters | |
| * with the ending if the text is longer than length. | |
| * | |
| * See: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/ | |
| * See also: wpengineer.com/2410/dont-use-strlen/ | |
| * See also also: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/#comment-1467093876 |
| <?php | |
| /* Plugin Name: Damn Vulnerable WordPress Plugin | |
| * Description: Intentionally vulnerable plugin for plugin author education | |
| * Version: 0.1 | |
| * Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/ | |
| * Author: Jon Cave | |
| * Author URI: http://joncave.co.uk | |
| * License: GPLv2+ | |
| * | |
| * DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE |
| <? | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |