From the error message, it appears that your prior iteration made use of the looser nature of PHP5:
Too few arguments to function printDirectory(), 3 passed … and
exactly 4 expected in …
I see that you define printDirectory() with four parameters:
- $url
- $root
- $path
- $sort
The first time you call this function, you pass all four parameters. Unfortunately, when you call it recursively (within the function itself) you only pass three of the four.
$sRtn .= printDirectory($url, $root, $path . "https://wordpress.stackexchange.com/" . $f);
Try passing the $sort variable in that recursive call.
Related Posts:
- Using plugin functionality in external php script not working
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- Disable plugin / plugin action via theme
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Need to create a Theme demo site that features multiple themes
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- Why does including a file in theme’s functions.php not work?
- WooCommerce create new product and add to cart on form submit
- WordPress plugin installation error
- Adding New Role
- Shortcode under a Shortcode Multiple times Possible?
- How to call a plugin function in footer.php
- Add Top-Level Menu that opens URL
- wordpress custom login successful redirect hook
- WordPress ajax call for not logged in users, doesn’t work
- Display All Non-Used Plugins
- Override plugin functions in functions.php
- New Plugin: Post update pushes a copy as a revision
- Placement of Code in Plugin for hooking `save_post`
- Display a text message if the field is not found and not if found
- Can I delete plugin files using FTP?
- Add get_option to jquery
- Add a plugin before main container
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- How does WordPress process plugin installations?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- wordpress plugin is not activating from widget
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Using a function to change favorites listing
- How to use a class from another plugin
- Why “Call to a member function on a non-object” in plugin only?
- WP Query. Is there a maximum size?
- How to remove custom post type and add category and post name
- bbPress plugin: forum lists not showing in correct order? [closed]
- Difference and examples of esc_attr__() and esc_attr_e()
- Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?
- How to prevent additional code in functions.php to be removed once there is an update?
- How to prevent PHP fatal error if plugin hasn’t been enabled and a method is called in theme file?
- Proper way to use plugin functions in functions.php
- How to reset the plugins without deactivate the plugin
- plugins_url() works everywhere but wp_reqister_script()
- Replacing global wp_query
- WordPress Stock Update Programatically
- How can I fetch data from another website to my wordpress website with mysql database
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- how to change wp-admin url using function file
- same user role or copy the user role to be same as the other role
- Expected ‘add_filter’ (T_STRING)
- Could not add ‘LoginLogout’ link using BAW login logout plugin
- My widget won’t update its values when save is clicked
- Execute a function when the entire page is displayed
- How can i listing current category and Featured Category post list?
- How to add custom function to pluggable.php
- grab or load text on demand
- sliding/fading header plugin or approach suggestion
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- How would I get the new plugin version on this function?
- Create category for each user
- Cannot pass value variable to WP AJAX functions
- Sharing varible between two add_actions
- Search in WordPress
- Fatal error: Class ‘RDTheme’ not found
- Modify function output in a plugin
- Override filter variable not working
- Is admin section completely customizable in terms of styling?
- How to make the first letter of a post title uppercase, in a plugin?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Making a Custom Post Type Plugin – keep getting the white screen of death
- How to replace native comment_count with Comments Evolved aggregate count
- Code fails in plugin file but works in functions.php
- Conditional required fields for WordPress Contact Form 7
- Hook into install email
- wordpress Shortocode running twice?
- Cannot access variables within a widget
- Calling an custom field from theme option at the frontend
- pluggable function in theme, to be overridden by plugin
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- Saving an array to get_options
- Doing action based on input from options menu
- add query string to all pages after user logged in
- Simple WordPress function / plugin to redirect a site
- Sync roles across several plugins
- Requires PHP version 5.3.0
- WP Elementor Pro causing crtical failure on website
- How to Add Extra Text In WordPress Title Before Post Publish
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- WordPress Convert queries to slashes using function.php