Skip to content

Instantly share code, notes, and snippets.

View itcomindo's full-sized avatar
🎯
Focusing

Budi Haryono itcomindo

🎯
Focusing
View GitHub Profile
@itcomindo
itcomindo / dosu.php
Created May 28, 2021 02:17 — forked from karthikax/dosu.php
PHP Download file to server from URL
<html>
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center">
Download a file from any URL</p>
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;">
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required>
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;">
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center">
To <?php echo getcwd(); ?></p>
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;">
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p>
<?php
// Add Meta Box to post
add_action('admin_init', 'single_rapater_meta_boxes', 2);
function single_rapater_meta_boxes() {
add_meta_box( 'single-repeter-data', 'Single Rapeter', 'single_repeatable_meta_box_callback', 'post', 'normal', 'default');
}
function single_repeatable_meta_box_callback($post) {
@akshuvo
akshuvo / WordPress Repeater MetaBox.php
Last active August 19, 2024 08:45
Creating a “repeater meta-box” without a Plugin in WordPress
<?php
add_action('admin_init', 'gpm_add_meta_boxes', 2);
function gpm_add_meta_boxes() {
add_meta_box( 'gpminvoice-group', 'Custom Repeatable', 'Repeatable_meta_box_display', 'page', 'normal', 'default');
}
function Repeatable_meta_box_display() {
global $post;
$gpminvoice_group = get_post_meta($post->ID, 'customdata_group', true);
@karthikax
karthikax / dosu.php
Last active December 31, 2022 06:16
PHP Download file to server from URL
<html>
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center">
Download a file from any URL</p>
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;">
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required>
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;">
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center">
To <?php echo getcwd(); ?></p>
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;">
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p>
@juliuzfan
juliuzfan / loop-sticky-posts.php
Created November 28, 2011 00:56
Custom WP Query For Sticky Posts Only
<?php
/**
Custom Query for Sticky Posts only
----------------------------------
*/
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 2, // Number of sticky posts to get
'post__in' => $sticky,
'ignore_sticky_posts' => 1