Automatically add a character to field in edit post page

Here is one idea: You could try to fire the change event of the #location-address (for example) input text field when the page has loaded: function custom_jquery() { echo “<script>jQuery(document).ready(function(){ jQuery(‘#location-address’).on( ‘change’, function( event ) { console.log(‘debug: on change fired!’); }); jQuery(‘#location-address’).change(); });</script>”; } add_action( ‘admin_head-post.php’, ‘custom_jquery’ ); if your editing page is post.php. You … Read more

Automate the installation of postfix on Ubuntu

You can use pre-seeding for this, using the debconf-set-selections command to pre-answer the questions asked by debconf before installing the package. For example: debconf-set-selections <<< “postfix postfix/mailname string your.hostname.com” debconf-set-selections <<< “postfix postfix/main_mailer_type string ‘Internet Site'” apt-get install –assume-yes postfix

No result update a custom field using wp_schedule_event

It think that your problem is the you are passing the post ID as url parameter to facebook API: $url = get_the_ID(); Also, as get_posts return an array of post objects, you could use this code: $posts = get_posts(array(‘numberposts’ => -1) ); foreach($posts as $post) { $url = get_permalink( $post->ID ); $fbcount = json_decode( file_get_contents( … Read more

Automatically generator a WordPress installation on my subdomain

You’ll want to setup a Multis-site network – https://codex.wordpress.org/Create_A_Network If you know your way around code what you’ll need to do is use the wpmu_create_blog() function – https://codex.wordpress.org/WPMU_Functions/wpmu_create_blog – to create a blog whenever a user registers. What I would recommend would be a front-end form so when someone registers they can enter the name … Read more

Automatically Add Page Links to Nav Menu

Turns out is_plugin_active is defined in wp-admin/includes/plugin.php so it’s only available within the admin unless I call it. I needed to add include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); so my final code was as shown below which I also tidied up a bit too. add_filter(‘wp_nav_menu_items’,’add_about_page_to_menu’, 10, 2); function add_about_page_to_menu( $items, $args ) { include_once( ABSPATH . … Read more

Automating WP application directory creation (domain name passed as a variable argument)

Ok, I just checked the WP CLI documentation. There are 3 important steps: Download WordPress: (I would use it with the options –path and –locale, but those are optional) wp core download Create a proper wp-config.php: wp config create –dbname=… –dbuser=… –dbpass=… –dbhost=… Install WordPress: wp core install –url=… –title=… –admin_user=… –admin_email=… Now there are … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)