How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?

To always get latest plugin take for example my plugin: http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/ the download link for the latest is: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.1.1.zip but if you remove the version from the download link you always get the latest version: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.zip EDIT: Have you considered keeping a folder of the latest wordpress and plugins unpacked? Then as soon as a … Read more

How to custom crop each image size?

You can customize or change WordPress image sizes using this function: http://codex.wordpress.org/Function_Reference/add_image_size <?php add_image_size( $name, $width, $height, $crop ); ?> The $crop parameter can be set to false for proportional or true for hard crop (it will hard crop from the center). If you use this function on already existing images you will need to … Read more

What’s a reliable way to depend on another plugin?

Consider plugin A: $A_message; add_action(‘plugins_loaded’, function() { do_action(‘plugin-A:init’); }); // Hooks allow B to access A (both during initialization of A and elsewhere in WordPress) without having to check if A exists. add_filter(‘plugin-A:set’, function($msg) { $A_message = $msg; }, PHP_INT_MAX); add_filter(‘plugin-A:get’, function($msg) { return $A_message; }, PHP_INT_MIN); Now, consider plugin B: add_action(‘plugin-A:init’, function() { // … Read more

How to include a plugin’s php file to another plugin functions file [duplicate]

The first error message means that there is restrictions in place on where you can include files from, set by the server. You could try with require_once ABSPATH . ‘/wp-content/plugins/pluginname/pluginfunctions.php’; but I’m not sure if it would work. With the second include you’re trying to include an URL which is disabled by the server for … Read more

Modifying a JS file with data from plugin settings

better is, you use the functions of WP for this, a example for multilanguage: add_action( ‘admin_enqueue_scripts’, ‘add_scripts’ ); function add_scripts($where) { wp_localize_script( ‘post2media’, ‘post2media_strings’, $this->localize_vars() ); } function localize_vars() { $strings = array( ‘btntext’ => __( ‘Link with post’, INPSYDE_P2M_TEXTDOMAIN ), ‘txtallnone’ => __( ‘Include in gallery:’, INPSYDE_P2M_TEXTDOMAIN ), ‘txtall’ => __( ‘All’, INPSYDE_P2M_TEXTDOMAIN ), … Read more