Icono del sitio Imacreste

Funciones WordPress: Functions.php

Todas las funciones que se usan habitualmente en el API de WordPress se encuentran en el núcleo, se usan para crear temas, plugins, crear menús nuevos en el gestor, etc. Vamos a ver donde se encuentran algunas de las más utilizadas.

Archivo: Functions.php

Es un repositorio de las funciones más comunes para interaccionar con WordPress.

De momento nombramos y explicamos algunas pocas para entender su funcionamiento y con tiempo, añadiremos más ejemplo. Hay que tener en cuenta que estas funciones pueden cambiar, ya que el CORE evoluciona.

<?php echo number_format_i18n(1,2)." - ";?> -> 1,00
$array=get_weekstartend(2015/21/07);

var_dump($array); --> array(2) { ["start"]=> int(1551049200) ["end"]=> int(1551653999) }
//en el form
wp_nonce_field('name_del_campo','name_del_campo_nonce');
//Al comprobar el envió
check_admin_referer('name_del_campo','name_del_campo_nonce');

Todas las funciones

Nuestra idea es ir comentando todas las funciones, de momento recogemos un listado, por si queremos ver todas las funciones del fichero de forma rápida.

mysql2date
current_time
date_i18n
number_format_i18n
size_format
get_weekstartend
maybe_unserialize
is_serialized
is_serialized_string
maybe_serialize
xmlrpc_getposttitle
xmlrpc_getpostcategory
xmlrpc_removepostdata
wp_extract_urls
do_enclose
wp_get_http
wp_get_http_headers
is_new_day
build_query
_http_build_query
add_query_arg
remove_query_arg
add_magic_quotes
wp_remote_fopen
wp
get_status_header_desc
status_header
wp_get_nocache_headers
nocache_headers
cache_javascript_headers
get_num_queries
bool_from_yn
do_feed
do_feed_rdf
do_feed_rss
do_feed_rss2
do_feed_atom
do_robots
is_blog_installed
wp_nonce_url
wp_nonce_field
wp_referer_field
wp_original_referer_field
wp_get_referer
wp_get_original_referer
wp_mkdir_p
path_is_absolute
path_join
wp_normalize_path
get_temp_dir
wp_is_writable
win_is_writable
wp_upload_dir
wp_unique_filename
wp_upload_bits
wp_ext2type
wp_check_filetype
wp_check_filetype_and_ext
wp_get_mime_types
get_allowed_mime_types
wp_nonce_ays
wp_die
_default_wp_die_handler
_xmlrpc_wp_die_handler
_ajax_wp_die_handler
_scalar_wp_die_handler
wp_json_encode
_wp_json_sanity_check
_wp_json_convert_string
wp_send_json
wp_send_json_success
wp_send_json_error
_config_wp_home
_config_wp_siteurl
_mce_set_direction
smilies_init
wp_parse_args
wp_parse_id_list
wp_array_slice_assoc
wp_filter_object_list
wp_list_filter
wp_list_pluck
wp_maybe_load_widgets
wp_widgets_add_menu
wp_ob_end_flush_all
dead_db
absint
_deprecated_function
_deprecated_file
_deprecated_argument
_doing_it_wrong
is_lighttpd_before_150
apache_mod_loaded
iis7_supports_permalinks
validate_file
is_ssl
force_ssl_login
force_ssl_admin
wp_guess_url
wp_suspend_cache_addition
wp_suspend_cache_invalidation
is_main_site
is_main_network
global_terms_enabled
wp_timezone_override_offset
_wp_timezone_choice_usort_callback
wp_timezone_choice
_cleanup_header_comment
wp_scheduled_delete
get_file_data
__return_true
__return_false
__return_zero
__return_empty_array
__return_null
__return_empty_string
send_nosniff_header
_wp_mysql_week
wp_find_hierarchy_loop
wp_find_hierarchy_loop_tortoise_hare
send_frame_options_header
wp_allowed_protocols
wp_debug_backtrace_summary
_get_non_cached_ids
_device_can_upload
wp_is_stream
wp_checkdate
wp_auth_check_load
wp_auth_check_html
wp_auth_check
get_tag_regex
_canonical_charset
mbstring_binary_safe_encoding
reset_mbstring_encoding
wp_validate_boolean
wp_delete_file

Salir de la versión móvil