Skip to content

Instantly share code, notes, and snippets.

View gh-o-st's full-sized avatar
💀
The same thing we do every day, Pinky...

gh0st gh-o-st

💀
The same thing we do every day, Pinky...
View GitHub Profile
@kamalahmed
kamalahmed / wp-attachment-url-to-path.php
Created February 14, 2019 17:23
You can convert an attachment url to its absolute path in WordPress using this function.
<?php
/**
* Get the attachment absolute path from its url
*
* @param string $url the attachment url to get its absolute path
*
* @return bool|string It returns the absolute path of an attachment
*/
function attachment_url_to_path( $url )
@vishalkakadiya
vishalkakadiya / manage_columns_wp_admin.php
Last active August 6, 2024 08:58
Manage custom columns with sortable in WordPress Admin side
<?php
/*
* =================================================================================================
* Below both hooks works for custom post types.
* e.g. Suppose we have custom post-type name : Books
* @ref https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column
* =================================================================================================
*/
@rattrap
rattrap / Request.php
Last active August 2, 2021 14:27
POST with cURL but failback to fopen
<?php
class Request {
/**
* do_post
* POST request
*
* @access public
* @param string $url - url