- Variables
- Types (Data type)
- Local vs Global Variables
- Scope of a variable
- Comments
- Single line comment
| <?php | |
| add_action( 'gform_after_submission', 'upload_photo', 10, 2 ); | |
| function convert_to_attachment( $entry, $form ) { | |
| // ID of the title field | |
| $title = rgar( $entry, 1 ); | |
| // ID of the upload button | |
| $url = rgar( $entry, 2 ); |
| admin_init | |
| - register_setting( $option_group, $option_name ) | |
| - add_settings_*() | |
| display hidden fields and security | |
| - settings_fields( $option_group ) [ Same parameter passed to register_setting() ] | |
| display sections | |
| - do_settings_section( $page ) |
| <?php | |
| /** | |
| * First we will create a settings page and add the name of the page to the | |
| * admin dashboard | |
| * Hook to be used in `admin_menu` | |
| */ | |
| add_action( 'admin_menu', 'wpgf_menu_page_setup' ); | |
| function wpgf_menu_page_setup() { | |
| add_menu_page( |
| { | |
| // The tab key will cycle through the settings when first created | |
| // Visit http://wbond.net/sublime_packages/sftp/settings for help | |
| // sftp, ftp or ftps | |
| "type": "sftp", | |
| "save_before_upload": true, | |
| "upload_on_save": true, | |
| "sync_down_on_open": false, |
| // |
| <?php | |
| /** | |
| * Adding a settings field in the already existing settings | |
| * page: general. | |
| */ | |
| add_action( 'admin_init', function() { | |
| /** | |
| * To create a settings field, it needs to be registered first. | |
| * Here we register a settings field called 'brand-name'. |
The frontend UI testing tests whether the contents of Give's features display and function as intended. These tests don't focus on the aesthetics but rather tests the correct output on the webpage and the interactions with it.
A sample wordpress.sql is provided within sample-data/ folder which has few sample forms, donations and donors to test in various combinations.
After setting up the local development environment, running tests manually is fairly simple. All you need it to run
Although Grunt and Gulp are both popular task runners, the Web Development community has moved to module bundlers such as Webpack since it can accomplish the same task as Grunt and Gulp, and in addition to that it can do a lot more.
The benefit of using Webpack is that it enables to work on projects as modules. We can have one webpack.config.js file for every project and use it as a starting point. It will achieve:
.js file