Q1. How will you disable theme and plugin editing in your WordPress admin?
Ans. Adding the following constant will disable theme and plugin editing from within the WordPress admin:
|| define(‘DISALLOW_FILE_EDIT’, true);
Q2. How will you prevent automatic update to a plugin which you have modified?
Ans. You can do it by changing the name of the plugin’s directory then activating it again into your WordPress dashboard. Alternatively, you can modify the name of the plugin to achieve the same.
1. What’s PHP ?
The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.
2. How can we know the number of days between two given dates using PHP?
$date1 = date(‘Y-m-d’);
$date2 = ‘2006-07-01’;
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
echo “Number of days since ‘2006-07-01’: $days”;
3. How do you define a constant?
define (“MYCONSTANT”, 100);
4. What is meant by urlencode and urldecode?
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits.
urlencode(“10.00%”) will return “10%2E00%25”. URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string. Continue reading