Unable to override pluggable function wp_mail

I think this line: namespace MailDemo; is the reason for you problems. You define your custom wp_mail() function within this namespace, so it looks like you’re trying to override the function: \MailDemo\wp_mail() but not the pluggable function: \wp_mail() Try to remove the namespace setup and see what happens. Another way around this would be to … Read more

How can I implement an Add to Collection function on my Image Gallery to be downloaded later?

I would skip cookies and use the awesome script store.js Just kick out a data-lightbox attribute on the “Add to Lightbox” link with the image ID and (assuming you’re using jQuery) it’s this simple: $( document.body ).on( “click”, “a[data-lightbox]”, function ( ev ) { ev.preventDefault(); var id = $( this ).data( “lightbox” ), list = … Read more

add_menu_page does not seem to work in a class

From add_menu_page in Codex: Note: If you’re running into the “You do not have sufficient permissions to access this page” error, then you’ve hooked too early. The hook you should use is admin_menu. admin_init is too early to hook add_menu_page, use admin_menu.

How to query the custom fields by language?

In qTranslate, there is this function that “dispatch” the language with the kind of string you have. Haven’t tested it yet, but you could do something like: $myString = get_post_meta( $post_id, ‘Functions’, true); echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($myMeta); This will display the right language on your post based on the current page’s language.