Tag Info

New answers tagged

0

Initialize the WP filesystem and no more using file_put_contents function. Try this: [...] global $wp_filesystem; // Initialize the WP filesystem, no more using 'file-put-contents' function if (empty($wp_filesystem)) { require_once (ABSPATH . '/wp-admin/includes/file.php'); WP_Filesystem(); } if(!$wp_filesystem->put_contents( $path, $css, 0644) ...


0

Unfortunately the documentation about the Filesystem API is very basic. What you are looking for is the dirlist method/function of the WP_Filesystem_$method class(es). The only documentation about it is the docblock out of the WP_Filesystem_Base class: /** * Get details for files in a directory or a specific file. * * @since 2.5.0 * * @param string ...


1

The method rmdir() - source - : /** * Delete a directory. * * @since 2.5.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool Whether directory is deleted successfully or not. */ public function rmdir( $path, $recursive = false ) { return ...



Top 50 recent answers are included