Browsed by
Snippet Category: Wordpress

Dont verify ssl

Dont verify ssl

add_filter(‘https_ssl_verify’, ‘__return_false’); add_filter(‘https_local_ssl_verify’, ‘__return_false’);

WordPress is_wp_error

WordPress is_wp_error

WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => SSL certificate problem: self signed certificate ) ) [error_data] => Array ( ) )

tinker get user

tinker get user

>>> $c = AppUsers::find(1); => AppUsers {#825 id: 1, name: "John", email: "it@rftags.co.za", created_at: "2018-02-14 09:53:01", updated_at: "2018-02-14 09:53:01", }

WordPress – View only own media

WordPress – View only own media

function my_files_only( $wp_query ) { if ( ! $_POST["action"] == "attachment" ) { return; } if ( current_user_can( ‘administrator’ ) ) { return; } global $current_user; $wp_query->set( ‘author’, $current_user->id ); } add_filter(‘parse_query’, ‘my_files_only’ );

http_request_timeout

http_request_timeout

function overwrite_wordpress_timeout( $timeout ) { return 60; // seconds } add_filter( ‘http_request_timeout’, ‘overwrite_wordpress_timeout’ );