autotutorial
Forum Replies Created
-
Forum: Networking WordPress
In reply to: Broke sites (idiot at work) please help!by default it is 1 for the primary site. What does it say to you if you look at a network installation Network->settings?
From WordPress 4.5 the default mapping has started working (it means not using plugin for mapping or obviously does not see domains added via plugin, if you want to use the default mapping)Forum: Fixing WordPress
In reply to: Database calls increased 4X due to “PWA Plugin call”static files can be cached, in all the url you see js which is a static file that can be stored in the browser, while admin-ajax.php is called by the javascript file with query string.
Don’t dig deep, that’s all normal.
I explained to you why the status code 200.Forum: Fixing WordPress
In reply to: Upgrading to PHP 7.2 breaking this function. How can I fix?Yes split is Removed from PHP 7.0, use preg_split for complex regex or explode for you have pices
mychar.Forum: Fixing WordPress
In reply to: Upgrading to PHP 7.2 breaking this function. How can I fix?list($empty, $parent, $child, $grandChild) = explode('/', $_SERVER['REQUEST_URI'], 4);
Explode for max 4 element.Forum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )I’m glad you solved, I update the topic that from WordPress 5.3 current_time always returns the correct time, before WordPress 5.3 maybe the correct time.
Forum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )Guido yes, DateImmutable returns a non-modifiable object useful in situations where it could be modified and this is the strength of current_datetime.
It is difficult to teach how to code if you have not studied programming, you must read a good php book.$array = current_datetime(); $localtime = $array->getTimestamp()+$array->getOffset();$array is the variable with the value of the object, to read the methods or properties we use
->, if the variable é $array each property or method refers to the object inside $arrayForum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )I @guido07111975 is that DateTime object.
But there is no need to convert to timestamps if you need the time used in your general settings.
can you show me the case of using the timestamp? if you use the old php function you have to calculate the offset of your php while if you use the DateTime object it will be converted automatically if you insert it in DateTimeZone.Forum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )The names are self-explanatory, if you insert the DateTime object into a variable you can access it through variable-name->method/property.
getTimestamp retrieves the $array timestamp while getOffset retrieves the $array offset.
https://www.php.net/manual/en/datetime.construct.php
https://www.php.net/manual/en/datetime.gettimestamp.phpForum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )$array = current_datetime(); //$localtime = $array->getTimestamp()+$array->getOffset(); // Convert english date $datetime2 = $array->format('Y-m-d H:i:s'); echo $datetime2."\n"; $datetime3 = new DateTime( $datetime2 ); $datetime3->setTimezone( new DateTimeZone('America/Atka') ); echo $datetime3->format('Y-m-d H:i:s')."\n";Forum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )$array = current_datetime(); $localtime = $array->getTimestamp()+$array->getOffset(); var_dump( time(), $localtime );I explained to you you will need to use the DateTime object instead of the old php functions.
@diondesignsNote:
As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead.
Forum: Developing with WordPress
In reply to: Replacement for current_time( ‘timestamp’ )From WordPress 5.3 changes have been made to the datetime component, updated code for the DateTime object.
I currently proposed a change. https://core.trac.wordpress.org/ticket/48976
date_default_timezone_set()it has no effect on the DateTime object if a valid DateTimeZone is specified , it is for use of date or strtotime function, instead of working with date / strtotime functions, create your code with DateTime and DateTimeZone, if you use the syntax setTimeZone for DateTimeZone it is available from php 5.2.1 otherwise DateTime exists from php 5.1 but is enabled by php 5.2 by default.$type = 'U'; $gmt = 0; current_time($type,$type);It should add the offset set in the general WordPress settings but does so only with my change.
$gmt = 1;for UTC.Forum: Localhost Installs
In reply to: Fatal error after upgrading to PHP 7.3Forum: Fixing WordPress
In reply to: What Happens to Internal Links After Permalink Change?https://wordpress.org/support/topic/regex-expression-for-permalink-change/
https://wordpress.org/plugins/redirection/
ask the plugin support.
Source:^/\d{4}/\d{2}/\d{2}/(.*)
Target:/$1/
4 for year, 2 month, 2 day, all chars (maybe postname or other).Forum: Fixing WordPress
In reply to: What Happens to Internal Links After Permalink Change?the content is inside the database, when you click on save the permalink paths are updated in your database, for this reason I suggest you make a redirect 301 to the new url.
Use the redirection plugin with a regex to resolve all the urls.
If you can show your permalink structure, we can help you find the right regex.Forum: Fixing WordPress
In reply to: having issues with WordPress in ChromeDid you say eliminating the cache? Here are two methods I recommend. https://wordpress.org/support/topic/corrupted-plugins/#post-12227823
In short, install the plugin and create a page rule, where you set the url without protocol on the wp-admin path and make sure you deselect the cache, you can enable security instead of leaving it turned off.