Changeset 992038
- Timestamp:
- 09/17/2014 04:27:38 PM (12 years ago)
- Location:
- advanced-custom-fields-rendering/trunk
- Files:
-
- 2 edited
-
acf_rendering.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-custom-fields-rendering/trunk/acf_rendering.php
r972233 r992038 4 4 * Plugin URI: http://www-sop.inria.fr/science-participative/wp-plugins/acf_rendering.zip 5 5 * Description: Adds rendering capabilities to Advanced Custom Fields. It allows to display the custom field values before or after the post page, and as HTML meta tags. 6 * Version: v1. 06 * Version: v1.1 7 7 * Author: Thierry.Vieville@inria.fr 8 8 * Author URI: http://www-sop.inria.fr/members/Thierry.Vieville … … 15 15 register_activation_hook( __FILE__, array($this, 'install' )); 16 16 register_deactivation_hook( __FILE__, array($this, 'uninstall' )); 17 add_action('admin_notices', array($this, 'install_failed_message')); 18 17 19 add_action('wp_head', array($this, 'acf_rendering_html_header')); 18 20 add_filter('the_content', array($this, 'acf_rendering_html_body'), 20, 1); 21 19 22 // Only available in English and French at that time 20 23 load_textdomain('acf', plugin_dir_path( __FILE__ ). '/lang/acfr-' . get_locale() . '.mo'); 21 24 } 22 23 25 // Installing/Uninstalling the advanced-custom-fields patches 24 26 function install() { 25 copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php'); 26 copy(plugin_dir_path( __FILE__ ). '/acf-patch/meta_box_rendering.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/views/meta_box_rendering.php'); 27 $ok1 = copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php'); 28 $ok2 = copy(plugin_dir_path( __FILE__ ). '/acf-patch/meta_box_rendering.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/views/meta_box_rendering.php'); 29 update_option("acf_rendering_install_failed", !($ok1 && $ok2)); 27 30 } 28 31 function uninstall() { 29 32 copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php.ori', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php'); 30 33 } 31 34 function install_failed_message() { 35 if (get_option("acf_rendering_install_failed")) 36 echo "<div class='error'><p>Sorry, your system forbids file update between plugins, <b>acf_rendering</b> will not work (desactivate the extension)</p></div>"; 37 } 38 private $install_failed = false; 32 39 // Returns the HTML body meta-data rendering 33 40 function acf_rendering_html_body($content) { -
advanced-custom-fields-rendering/trunk/readme.txt
r968129 r992038 56 56 == Changelog == 57 57 58 = 1.1 = 59 60 Add an admin notice if the system forbids file update between plugins 61 58 62 = 1.0 = 59 63 … … 61 65 62 66 == Upgrade Notice == 67 68 = 1.1 = 69 70 Add an admin notice if the system forbids file update between plugins 63 71 64 72 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.