WP_Filesystem_SSH2::mkdir() – Creates a directory.

You appear to be a bot. Output may be restricted

Description

Creates a directory.

Usage

$bool = WP_Filesystem_SSH2::mkdir( $path, $chmod, $chown, $chgrp );

Parameters

$path
( string ) required – Path for new directory.
$chmod
( int|false ) optional – Optional. The permissions as octal number (or false to skip chmod). Default false.
$chown
( string|int|false ) optional – Optional. A user name or number (or false to skip chown). Default false.
$chgrp
( string|int|false ) optional – Optional. A group name or number (or false to skip chgrp). Default false.

Returns

bool True on success, false on failure.

Source

File name: wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
Lines:

1 to 28 of 28
  public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
    $path = untrailingslashit( $path );

    if ( empty( $path ) ) {
      return false;
    }

    if ( ! $chmod ) {
      $chmod = FS_CHMOD_DIR;
    }

    if ( ! ssh2_sftp_mkdir( $this->sftp_link, $path, $chmod, true ) ) {
      return false;
    }

    // Set directory permissions.
    ssh2_sftp_chmod( $this->sftp_link, $path, $chmod );

    if ( $chown ) {
      $this->WP_Filesystem_SSH2::chown( $path, $chown );
    }

    if ( $chgrp ) {
      $this->WP_Filesystem_SSH2::chgrp( $path, $chgrp );
    }

    return true;
  }
 

 View on GitHub View on Trac