wp_mail is undefined

You may call the function too early. You have to wait until the action ‘plugins_loaded’ fires. wp_mail() is defined in wp-includes/pluggable.php. pluggable.php is loaded in wp-settings.php after the plugins are loaded but before ‘plugins_loaded’ is called. See this answer for an example.

Are shortcodes case-sensitive?

Short Answer Yes, shortcodes are case sensitive Longer Answer It’s really easy to build a test case for this and see. <?php add_shortcode(‘sOme_ShOrTcOdE’, ‘wpse102375_shortcode’); function wpse102375_shortcode($args, $content=null) { return ‘yep’; } Longest Answer Read the source. The “magic” with shortcodes happens in do_shortcode, so let’s take a look at that. <?php // wp-includes/shortcode.php function do_shortcode($content) … Read more

Clarity needed on usage of multiple 403 forbidden header() functions at the beginning of the plugin files

The proper way to send a status (when WordPress is not available) is: http_response_code( 403 ); See the PHP Manual for its definition. But in Plugin files, this should never be the “default” code on top of a file header. See Worthwhile to restrict direct access of theme files? for a discussion. In WordPress, use … Read more

How to get Post ID with the Add Filter Function

Nevermind, found out I can use get_the_ID();. This function will return the post id inside the the_content filter. The function simply declares the global $post object and returns its ID. add_filter(‘the_content’, ‘wpse51205_content’) wpse51205_content($content) { echo $content; // Echo out post content $PersonName = get_post_meta(get_the_ID(), ‘PersonName’, true); echo ‘Person: ‘ . $PersonName; } If you don’t … Read more

How can I track active users of my plugin? and why doesn’t WordPress.Org offer this?

You cannot get these data. There are several issues with plugin usage tracking: No clear definition of a user: Think multi-site, local installations, intranets … Privacy: You would have to ask the user before you can activate tracking. There are many good reasons not to send any data to an unknown entity without consent (traffic, … Read more

Where do I start from

Glad your taking the jump into wordpress, wordpress is an amazing platform for developers and non-developers alike, if you have knowledge of PHP, HTML, CSS (and jQuery in some instances) you will enjoy working with wordpress. A great place to start understanding wordpress would of-course be the wordpress website itself. http://codex.wordpress.org/Main_Page I hope this helps, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)