WordPress media upload limit?

Three things you need to check. upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file exactly. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. Typically post_max_size and memory_limit need to be larger than upload_max_filesize. This is the function in WordPress that defines the constant … Read more

Any way to use a custom Parameter for youtube embed without using an iframe?

No need for a plugin, You can simply use the Oembed class’s oembed_result filter hook like this: function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id[‘v’])) { return ‘<iframe width=”‘.$args[‘width’].'” height=”‘.$args[‘height’].'” src=”http://www.youtube.com/embed/’.$id[‘v’].’?rel=0&showinfo=0″ frameborder=”0″ allowfullscreen></iframe>’; } return $html; } add_filter(‘oembed_result’,’Oembed_youtube_no_title’,10,3); so just paste this code in your theme’s functions.php file, setup the width and height … Read more

Shortcode display outside the div

Use this instead: Concatenate the html then return it. function check_my_login( $atts) { $html=”<form action=”” name=”” method=”post” enctype=”multipart/form-data”>”; $html .= ‘<div class=”form-group”>’; $html .= ‘<label for=”description”>Project Description</label>’; $html .= ‘<textarea name=”p_description” placeholder=”Project Description” class=”form-control”>’; if(isset($_POST[‘p_description’]) && $_POST[‘p_description’] != ”){ $html .= $_POST[‘p_description’]; } $html .= ‘</textarea>’; $html .= ‘</div>’; $html .= ‘<div class=”form-group”>’; $html .= … Read more

Article source link for posts

Thats what meta_boxes are for. First you need to register the metabox within the page or post with the function add_meta_box. Then you want to get that value with get_post_meta on the page where you want the “Source”. This goes into your functions.php file: /* Define the custom box */ add_action( ‘add_meta_boxes’, ‘wpse_source_link’ ); /* … Read more

A plugin for having rel=”nofollow” in posts?

you can add a filter in your functions.php add // Nofollow in content add_filter(‘the_content’, ‘my_nofollow’); function my_nofollow($content) { //return stripslashes(wp_rel_nofollow($content)); return preg_replace_callback(‘/<a[^>]+/’, ‘my_nofollow_callback’, $content); } function my_nofollow_callback($matches) { $link = $matches[0]; $site_link = get_bloginfo(‘url’); if (strpos($link, ‘rel’) === false) { $link = preg_replace(“%(href=\S(?!$site_link))%i”, ‘rel=”nofollow” $1’, $link); } elseif (preg_match(“%href=\S(?!$site_link)%i”, $link)) { $link = preg_replace(‘/rel=\S(?!nofollow)\S*/i’, ‘rel=”nofollow”‘, … Read more

AJAX Call Via Vanilla JavaScript In WordPress Plugin Development

Thanks Muhammad, Your solution is a fantastic working framework on which to base real world AJAX calls. I just added this code to the plugin main php file for a shortcode so I could use it in the Front End too. //For front end use in production add_shortcode(‘wp_testingPlugin_shortcode’, ‘wp_testingPlugin_shortcode’); function wp_testingPlugin_shortcode() { wp_enqueue_script( ‘ajax-script’, plugin_dir_url( … Read more

Trying to avoid including wp-load.php

Add a rewrite endpoint to give your plugin a public URL- function wpa_my_endpoint(){ add_rewrite_endpoint( ‘my_api’, EP_ROOT ); } add_action( ‘init’, ‘wpa_my_endpoint’ ); After you flush rewrite rules, you’ll have the URL available for the scheduler to ping. http://example.com/my_api/do/something/ Then catch those requests on the parse_query action to invoke your plugin action: function wpa_parse_query( $query ){ … Read more

How to use a Must-Use plugin to hide a regular one and to hide itself?

Apparently, there’s no way to remove one plugin from the Must-Use list… But then, found a filter that does even better: show_advanced_plugins will completely hide the sight of the Must-Use plugins. After all, if you’re trying to hide something of this nature, then hide it all… It’s inside the class WP_Plugins_List_Table and takes two arguments: … Read more

Claim Listing functionality – how to send email to users when their claim has been approved or denied

Unfortunately, the developers didn’t give you any hooks in their code to allow for customization without hacking it. But all is not lost – there are some hooks in WP that you could use to trigger your emails. The ideal would be to trigger off the update_post_meta(). That function is simply a wrapper for update_metadata() … Read more