• Dear all,

    after a php version update to 7.3, we encountered a problem on the plugin and the media gallery section of our site has stopped working with an error about a deprecated create_function.
    We write here how we have solved it in case it serves others.
    To solve the problem it is necessary to modify the following two files:

    /wp-content/plugins/file-gallery/includes/media-tags.php
    change row 48 from:

    create_function(”, ‘file_gallery_media_tags_permalink_fields(“media_tag_taxonomy_name”);’),

    to:

    function(){file_gallery_media_tags_permalink_fields(“media_tag_taxonomy_name”);},

    and change row 55 from:

    create_function(”, ‘file_gallery_media_tags_permalink_fields(“media_tag_taxonomy_slug”);’),

    to:

    function(){file_gallery_media_tags_permalink_fields(“media_tag_taxonomy_slug”);},

    /wp-content/plugins/file-gallery/includes/media-settings.php
    change row 43 from:

    add_settings_field(“size_” . $size, $translated_size . $size_translated, create_function(”, ‘echo file_gallery_options_fields( array(“name” => “‘ . $size . ‘”, “type” => “intermediate_image_sizes”, “disabled” => 0) );’), ‘media’, ‘intermediate_image_sizes’);

    to:

    add_settings_field(“size_” . $size, $translated_size . $size_translated, function(){echo file_gallery_options_fields( array(“name” => “‘ . $size . ‘”, “type” => “intermediate_image_sizes”, “disabled” => 0) );}, ‘media’, ‘intermediate_image_sizes’);

    Best regards
    MVP-Arena Team

    • This topic was modified 6 years, 4 months ago by mvparena.

The topic ‘Deprecated create_function after php version upgrade 7.3’ is closed to new replies.