This file contains 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
#!/bin/bash | |
if [[ ! "$(/usr/sbin/service mysql status)" =~ "running" ]] | |
then | |
/usr/sbin/service mysql restart | |
echo "$(date) - mysql restarted." >> /var/log/restart_mysql.log | |
fi |
This file contains 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_filter('ninja_forms_render_options','ninja_forms_pre_population_callback', 10, 2); | |
function ninja_forms_pre_population_callback($options, $settings) { | |
// target only the field with this key | |
if( $settings['key'] == 'my_field_key' ) { | |
// write the query to fetch the data | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish' |