wpsc_remove_marker()
No Hooks.
Return
null
. Nothing (null).
Usage
wpsc_remove_marker( $filename, $marker );
- $filename (required)
- -
- $marker (required)
- -
wpsc_remove_marker() wpsc remove marker code WPSCache 1.12.4
function wpsc_remove_marker( $filename, $marker ) { if (!file_exists( $filename ) || is_writeable_ACLSafe( $filename ) ) { if (!file_exists( $filename ) ) { return ''; } else { $markerdata = explode( "\n", implode( '', file( $filename ) ) ); } $f = fopen( $filename, 'w' ); if ( $markerdata ) { $state = true; foreach ( $markerdata as $n => $markerline ) { if (strpos($markerline, '# BEGIN ' . $marker) !== false) $state = false; if ( $state ) { if ( $n + 1 < count( $markerdata ) ) fwrite( $f, "{$markerline}\n" ); else fwrite( $f, "{$markerline}" ); } if (strpos($markerline, '# END ' . $marker) !== false) { $state = true; } } } return true; } else { return false; } }