最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to display or print WordPress memory limit and WordPress max memory limit

programmeradmin0浏览0评论

What code do I need to use to display the WordPress memory limit and WordPress maximum memory limit.

In PHP for example, I can just get the memory limit by using:

echo $memory_limit = ini_get('memory_limit');

What would be a similar equivalent in WordPress?

What code do I need to use to display the WordPress memory limit and WordPress maximum memory limit.

In PHP for example, I can just get the memory limit by using:

echo $memory_limit = ini_get('memory_limit');

What would be a similar equivalent in WordPress?

Share Improve this question edited Sep 30, 2019 at 13:37 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Sep 30, 2019 at 11:43 chinazaikechinazaike 1072 bronze badges 4
  • That's probably still right. I don't think WordPress has a separate memory limit, does it? The limits will be from the PHP environment. – Rup Commented Sep 30, 2019 at 11:50
  • am talking of how to echo values of memory limit and maximum memory limit already set by my wordpress aplications – chinazaike Commented Sep 30, 2019 at 11:57
  • OK, there is wp_raise_memory_limit. Is that what you meant? Are your applications using this as a matter of course? They probably shouldn't be. At first glance that's just the WP_MAX_MEMORY_LIMIT constant, if wp_is_ini_value_changeable( 'memory_limit' ) is true. – Rup Commented Sep 30, 2019 at 12:07
  • Thanks Rup. Thats is what am looking for. You can update it as answer – chinazaike Commented Sep 30, 2019 at 12:15
Add a comment  | 

1 Answer 1

Reset to default 1

Resolved via this functions as suggested by Rup

wp_is_ini_value_changeable( 'memory_limit' )

source link

发布评论

评论列表(0)

  1. 暂无评论