programmatically add wpml string translation

posted in: Uncategorized | 0

First we need to register the string on wpml translation table.

The above function will return a string_id and we will need this id for icl_add_string_translation() function to add labels for other languages.

Alternatively, we can use icl_get_string_id() … Continued

How to Set an Expires Header in Apache

posted in: Uncategorized | 0

Enalbe mod_expires on server LoadModule expires_module modules/

present a pdf file for download via PHP after checking some rules

posted in: Uncategorized | 0

First we create a rule on htaccess and redirect the pdf files to a php with its path as query string

The sample code for the pdf-viewer.php.

Remove illegal characters from files during uploading on wordpress

posted in: Uncategorized | 0

wp_handle_upload_prefilter allows user to change the files during uploads. ex.

posted in: Uncategorized | 0

Remove unnecessary tags inside shortcodes by postponing the wp_autop remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 12);