Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: deprecated.php
function the_author_icq() {
[1500] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'icq\')' );
[1501] Fix | Delete
the_author_meta('icq');
[1502] Fix | Delete
}
[1503] Fix | Delete
[1504] Fix | Delete
/**
[1505] Fix | Delete
* Retrieve the Yahoo! IM name of the author of the current post.
[1506] Fix | Delete
*
[1507] Fix | Delete
* @since 1.5.0
[1508] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1509] Fix | Delete
* @see get_the_author_meta()
[1510] Fix | Delete
*
[1511] Fix | Delete
* @return string The author's Yahoo! IM name.
[1512] Fix | Delete
*/
[1513] Fix | Delete
function get_the_author_yim() {
[1514] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'yim\')' );
[1515] Fix | Delete
return get_the_author_meta('yim');
[1516] Fix | Delete
}
[1517] Fix | Delete
[1518] Fix | Delete
/**
[1519] Fix | Delete
* Display the Yahoo! IM name of the author of the current post.
[1520] Fix | Delete
*
[1521] Fix | Delete
* @since 0.71
[1522] Fix | Delete
* @deprecated 2.8.0 Use the_author_meta()
[1523] Fix | Delete
* @see the_author_meta()
[1524] Fix | Delete
*/
[1525] Fix | Delete
function the_author_yim() {
[1526] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'yim\')' );
[1527] Fix | Delete
the_author_meta('yim');
[1528] Fix | Delete
}
[1529] Fix | Delete
[1530] Fix | Delete
/**
[1531] Fix | Delete
* Retrieve the MSN address of the author of the current post.
[1532] Fix | Delete
*
[1533] Fix | Delete
* @since 1.5.0
[1534] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1535] Fix | Delete
* @see get_the_author_meta()
[1536] Fix | Delete
*
[1537] Fix | Delete
* @return string The author's MSN address.
[1538] Fix | Delete
*/
[1539] Fix | Delete
function get_the_author_msn() {
[1540] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'msn\')' );
[1541] Fix | Delete
return get_the_author_meta('msn');
[1542] Fix | Delete
}
[1543] Fix | Delete
[1544] Fix | Delete
/**
[1545] Fix | Delete
* Display the MSN address of the author of the current post.
[1546] Fix | Delete
*
[1547] Fix | Delete
* @since 0.71
[1548] Fix | Delete
* @deprecated 2.8.0 Use the_author_meta()
[1549] Fix | Delete
* @see the_author_meta()
[1550] Fix | Delete
*/
[1551] Fix | Delete
function the_author_msn() {
[1552] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'msn\')' );
[1553] Fix | Delete
the_author_meta('msn');
[1554] Fix | Delete
}
[1555] Fix | Delete
[1556] Fix | Delete
/**
[1557] Fix | Delete
* Retrieve the AIM address of the author of the current post.
[1558] Fix | Delete
*
[1559] Fix | Delete
* @since 1.5.0
[1560] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1561] Fix | Delete
* @see get_the_author_meta()
[1562] Fix | Delete
*
[1563] Fix | Delete
* @return string The author's AIM address.
[1564] Fix | Delete
*/
[1565] Fix | Delete
function get_the_author_aim() {
[1566] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'aim\')' );
[1567] Fix | Delete
return get_the_author_meta('aim');
[1568] Fix | Delete
}
[1569] Fix | Delete
[1570] Fix | Delete
/**
[1571] Fix | Delete
* Display the AIM address of the author of the current post.
[1572] Fix | Delete
*
[1573] Fix | Delete
* @since 0.71
[1574] Fix | Delete
* @deprecated 2.8.0 Use the_author_meta('aim')
[1575] Fix | Delete
* @see the_author_meta()
[1576] Fix | Delete
*/
[1577] Fix | Delete
function the_author_aim() {
[1578] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'aim\')' );
[1579] Fix | Delete
the_author_meta('aim');
[1580] Fix | Delete
}
[1581] Fix | Delete
[1582] Fix | Delete
/**
[1583] Fix | Delete
* Retrieve the specified author's preferred display name.
[1584] Fix | Delete
*
[1585] Fix | Delete
* @since 1.0.0
[1586] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1587] Fix | Delete
* @see get_the_author_meta()
[1588] Fix | Delete
*
[1589] Fix | Delete
* @param int $auth_id The ID of the author.
[1590] Fix | Delete
* @return string The author's display name.
[1591] Fix | Delete
*/
[1592] Fix | Delete
function get_author_name( $auth_id = false ) {
[1593] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'display_name\')' );
[1594] Fix | Delete
return get_the_author_meta('display_name', $auth_id);
[1595] Fix | Delete
}
[1596] Fix | Delete
[1597] Fix | Delete
/**
[1598] Fix | Delete
* Retrieve the URL to the home page of the author of the current post.
[1599] Fix | Delete
*
[1600] Fix | Delete
* @since 1.5.0
[1601] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1602] Fix | Delete
* @see get_the_author_meta()
[1603] Fix | Delete
*
[1604] Fix | Delete
* @return string The URL to the author's page.
[1605] Fix | Delete
*/
[1606] Fix | Delete
function get_the_author_url() {
[1607] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'url\')' );
[1608] Fix | Delete
return get_the_author_meta('url');
[1609] Fix | Delete
}
[1610] Fix | Delete
[1611] Fix | Delete
/**
[1612] Fix | Delete
* Display the URL to the home page of the author of the current post.
[1613] Fix | Delete
*
[1614] Fix | Delete
* @since 0.71
[1615] Fix | Delete
* @deprecated 2.8.0 Use the_author_meta()
[1616] Fix | Delete
* @see the_author_meta()
[1617] Fix | Delete
*/
[1618] Fix | Delete
function the_author_url() {
[1619] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'url\')' );
[1620] Fix | Delete
the_author_meta('url');
[1621] Fix | Delete
}
[1622] Fix | Delete
[1623] Fix | Delete
/**
[1624] Fix | Delete
* Retrieve the ID of the author of the current post.
[1625] Fix | Delete
*
[1626] Fix | Delete
* @since 1.5.0
[1627] Fix | Delete
* @deprecated 2.8.0 Use get_the_author_meta()
[1628] Fix | Delete
* @see get_the_author_meta()
[1629] Fix | Delete
*
[1630] Fix | Delete
* @return string|int The author's ID.
[1631] Fix | Delete
*/
[1632] Fix | Delete
function get_the_author_ID() {
[1633] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'ID\')' );
[1634] Fix | Delete
return get_the_author_meta('ID');
[1635] Fix | Delete
}
[1636] Fix | Delete
[1637] Fix | Delete
/**
[1638] Fix | Delete
* Display the ID of the author of the current post.
[1639] Fix | Delete
*
[1640] Fix | Delete
* @since 0.71
[1641] Fix | Delete
* @deprecated 2.8.0 Use the_author_meta()
[1642] Fix | Delete
* @see the_author_meta()
[1643] Fix | Delete
*/
[1644] Fix | Delete
function the_author_ID() {
[1645] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta(\'ID\')' );
[1646] Fix | Delete
the_author_meta('ID');
[1647] Fix | Delete
}
[1648] Fix | Delete
[1649] Fix | Delete
/**
[1650] Fix | Delete
* Display the post content for the feed.
[1651] Fix | Delete
*
[1652] Fix | Delete
* For encoding the HTML or the $encode_html parameter, there are three possible values:
[1653] Fix | Delete
* - '0' will make urls footnotes and use make_url_footnote().
[1654] Fix | Delete
* - '1' will encode special characters and automatically display all of the content.
[1655] Fix | Delete
* - '2' will strip all HTML tags from the content.
[1656] Fix | Delete
*
[1657] Fix | Delete
* Also note that you cannot set the amount of words and not set the HTML encoding.
[1658] Fix | Delete
* If that is the case, then the HTML encoding will default to 2, which will strip
[1659] Fix | Delete
* all HTML tags.
[1660] Fix | Delete
*
[1661] Fix | Delete
* To restrict the amount of words of the content, you can use the cut parameter.
[1662] Fix | Delete
* If the content is less than the amount, then there won't be any dots added to the end.
[1663] Fix | Delete
* If there is content left over, then dots will be added and the rest of the content
[1664] Fix | Delete
* will be removed.
[1665] Fix | Delete
*
[1666] Fix | Delete
* @since 0.71
[1667] Fix | Delete
*
[1668] Fix | Delete
* @deprecated 2.9.0 Use the_content_feed()
[1669] Fix | Delete
* @see the_content_feed()
[1670] Fix | Delete
*
[1671] Fix | Delete
* @param string $more_link_text Optional. Text to display when more content is available
[1672] Fix | Delete
* but not displayed. Default '(more...)'.
[1673] Fix | Delete
* @param int $stripteaser Optional. Default 0.
[1674] Fix | Delete
* @param string $more_file Optional.
[1675] Fix | Delete
* @param int $cut Optional. Amount of words to keep for the content.
[1676] Fix | Delete
* @param int $encode_html Optional. How to encode the content.
[1677] Fix | Delete
*/
[1678] Fix | Delete
function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
[1679] Fix | Delete
_deprecated_function( __FUNCTION__, '2.9.0', 'the_content_feed()' );
[1680] Fix | Delete
$content = get_the_content($more_link_text, $stripteaser);
[1681] Fix | Delete
[1682] Fix | Delete
/**
[1683] Fix | Delete
* Filters the post content in the context of an RSS feed.
[1684] Fix | Delete
*
[1685] Fix | Delete
* @since 0.71
[1686] Fix | Delete
*
[1687] Fix | Delete
* @param string $content Content of the current post.
[1688] Fix | Delete
*/
[1689] Fix | Delete
$content = apply_filters('the_content_rss', $content);
[1690] Fix | Delete
if ( $cut && !$encode_html )
[1691] Fix | Delete
$encode_html = 2;
[1692] Fix | Delete
if ( 1== $encode_html ) {
[1693] Fix | Delete
$content = esc_html($content);
[1694] Fix | Delete
$cut = 0;
[1695] Fix | Delete
} elseif ( 0 == $encode_html ) {
[1696] Fix | Delete
$content = make_url_footnote($content);
[1697] Fix | Delete
} elseif ( 2 == $encode_html ) {
[1698] Fix | Delete
$content = strip_tags($content);
[1699] Fix | Delete
}
[1700] Fix | Delete
if ( $cut ) {
[1701] Fix | Delete
$blah = explode(' ', $content);
[1702] Fix | Delete
if ( count($blah) > $cut ) {
[1703] Fix | Delete
$k = $cut;
[1704] Fix | Delete
$use_dotdotdot = 1;
[1705] Fix | Delete
} else {
[1706] Fix | Delete
$k = count($blah);
[1707] Fix | Delete
$use_dotdotdot = 0;
[1708] Fix | Delete
}
[1709] Fix | Delete
[1710] Fix | Delete
/** @todo Check performance, might be faster to use array slice instead. */
[1711] Fix | Delete
for ( $i=0; $i<$k; $i++ )
[1712] Fix | Delete
$excerpt .= $blah[$i].' ';
[1713] Fix | Delete
$excerpt .= ($use_dotdotdot) ? '...' : '';
[1714] Fix | Delete
$content = $excerpt;
[1715] Fix | Delete
}
[1716] Fix | Delete
$content = str_replace(']]>', ']]&gt;', $content);
[1717] Fix | Delete
echo $content;
[1718] Fix | Delete
}
[1719] Fix | Delete
[1720] Fix | Delete
/**
[1721] Fix | Delete
* Strip HTML and put links at the bottom of stripped content.
[1722] Fix | Delete
*
[1723] Fix | Delete
* Searches for all of the links, strips them out of the content, and places
[1724] Fix | Delete
* them at the bottom of the content with numbers.
[1725] Fix | Delete
*
[1726] Fix | Delete
* @since 0.71
[1727] Fix | Delete
* @deprecated 2.9.0
[1728] Fix | Delete
*
[1729] Fix | Delete
* @param string $content Content to get links.
[1730] Fix | Delete
* @return string HTML stripped out of content with links at the bottom.
[1731] Fix | Delete
*/
[1732] Fix | Delete
function make_url_footnote( $content ) {
[1733] Fix | Delete
_deprecated_function( __FUNCTION__, '2.9.0', '' );
[1734] Fix | Delete
preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
[1735] Fix | Delete
$links_summary = "\n";
[1736] Fix | Delete
for ( $i = 0, $c = count( $matches[0] ); $i < $c; $i++ ) {
[1737] Fix | Delete
$link_match = $matches[0][$i];
[1738] Fix | Delete
$link_number = '['.($i+1).']';
[1739] Fix | Delete
$link_url = $matches[2][$i];
[1740] Fix | Delete
$link_text = $matches[4][$i];
[1741] Fix | Delete
$content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
[1742] Fix | Delete
$link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) !== 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) !== 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
[1743] Fix | Delete
$links_summary .= "\n" . $link_number . ' ' . $link_url;
[1744] Fix | Delete
}
[1745] Fix | Delete
$content = strip_tags( $content );
[1746] Fix | Delete
$content .= $links_summary;
[1747] Fix | Delete
return $content;
[1748] Fix | Delete
}
[1749] Fix | Delete
[1750] Fix | Delete
/**
[1751] Fix | Delete
* Retrieve translated string with vertical bar context
[1752] Fix | Delete
*
[1753] Fix | Delete
* Quite a few times, there will be collisions with similar translatable text
[1754] Fix | Delete
* found in more than two places but with different translated context.
[1755] Fix | Delete
*
[1756] Fix | Delete
* In order to use the separate contexts, the _c() function is used and the
[1757] Fix | Delete
* translatable string uses a pipe ('|') which has the context the string is in.
[1758] Fix | Delete
*
[1759] Fix | Delete
* When the translated string is returned, it is everything before the pipe, not
[1760] Fix | Delete
* including the pipe character. If there is no pipe in the translated text then
[1761] Fix | Delete
* everything is returned.
[1762] Fix | Delete
*
[1763] Fix | Delete
* @since 2.2.0
[1764] Fix | Delete
* @deprecated 2.9.0 Use _x()
[1765] Fix | Delete
* @see _x()
[1766] Fix | Delete
*
[1767] Fix | Delete
* @param string $text Text to translate.
[1768] Fix | Delete
* @param string $domain Optional. Domain to retrieve the translated text.
[1769] Fix | Delete
* @return string Translated context string without pipe.
[1770] Fix | Delete
*/
[1771] Fix | Delete
function _c( $text, $domain = 'default' ) {
[1772] Fix | Delete
_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );
[1773] Fix | Delete
return before_last_bar( translate( $text, $domain ) );
[1774] Fix | Delete
}
[1775] Fix | Delete
[1776] Fix | Delete
/**
[1777] Fix | Delete
* Translates $text like translate(), but assumes that the text
[1778] Fix | Delete
* contains a context after its last vertical bar.
[1779] Fix | Delete
*
[1780] Fix | Delete
* @since 2.5.0
[1781] Fix | Delete
* @deprecated 3.0.0 Use _x()
[1782] Fix | Delete
* @see _x()
[1783] Fix | Delete
*
[1784] Fix | Delete
* @param string $text Text to translate.
[1785] Fix | Delete
* @param string $domain Domain to retrieve the translated text.
[1786] Fix | Delete
* @return string Translated text.
[1787] Fix | Delete
*/
[1788] Fix | Delete
function translate_with_context( $text, $domain = 'default' ) {
[1789] Fix | Delete
_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );
[1790] Fix | Delete
return before_last_bar( translate( $text, $domain ) );
[1791] Fix | Delete
}
[1792] Fix | Delete
[1793] Fix | Delete
/**
[1794] Fix | Delete
* Legacy version of _n(), which supports contexts.
[1795] Fix | Delete
*
[1796] Fix | Delete
* Strips everything from the translation after the last bar.
[1797] Fix | Delete
*
[1798] Fix | Delete
* @since 2.7.0
[1799] Fix | Delete
* @deprecated 3.0.0 Use _nx()
[1800] Fix | Delete
* @see _nx()
[1801] Fix | Delete
*
[1802] Fix | Delete
* @param string $single The text to be used if the number is singular.
[1803] Fix | Delete
* @param string $plural The text to be used if the number is plural.
[1804] Fix | Delete
* @param int $number The number to compare against to use either the singular or plural form.
[1805] Fix | Delete
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
[1806] Fix | Delete
* Default 'default'.
[1807] Fix | Delete
* @return string The translated singular or plural form.
[1808] Fix | Delete
*/
[1809] Fix | Delete
function _nc( $single, $plural, $number, $domain = 'default' ) {
[1810] Fix | Delete
_deprecated_function( __FUNCTION__, '2.9.0', '_nx()' );
[1811] Fix | Delete
return before_last_bar( _n( $single, $plural, $number, $domain ) );
[1812] Fix | Delete
}
[1813] Fix | Delete
[1814] Fix | Delete
/**
[1815] Fix | Delete
* Retrieve the plural or single form based on the amount.
[1816] Fix | Delete
*
[1817] Fix | Delete
* @since 1.2.0
[1818] Fix | Delete
* @deprecated 2.8.0 Use _n()
[1819] Fix | Delete
* @see _n()
[1820] Fix | Delete
*/
[1821] Fix | Delete
function __ngettext( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
[1822] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', '_n()' );
[1823] Fix | Delete
return _n( ...$args );
[1824] Fix | Delete
}
[1825] Fix | Delete
[1826] Fix | Delete
/**
[1827] Fix | Delete
* Register plural strings in POT file, but don't translate them.
[1828] Fix | Delete
*
[1829] Fix | Delete
* @since 2.5.0
[1830] Fix | Delete
* @deprecated 2.8.0 Use _n_noop()
[1831] Fix | Delete
* @see _n_noop()
[1832] Fix | Delete
*/
[1833] Fix | Delete
function __ngettext_noop( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
[1834] Fix | Delete
_deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' );
[1835] Fix | Delete
return _n_noop( ...$args );
[1836] Fix | Delete
[1837] Fix | Delete
}
[1838] Fix | Delete
[1839] Fix | Delete
/**
[1840] Fix | Delete
* Retrieve all autoload options, or all options if no autoloaded ones exist.
[1841] Fix | Delete
*
[1842] Fix | Delete
* @since 1.0.0
[1843] Fix | Delete
* @deprecated 3.0.0 Use wp_load_alloptions())
[1844] Fix | Delete
* @see wp_load_alloptions()
[1845] Fix | Delete
*
[1846] Fix | Delete
* @return array List of all options.
[1847] Fix | Delete
*/
[1848] Fix | Delete
function get_alloptions() {
[1849] Fix | Delete
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_load_alloptions()' );
[1850] Fix | Delete
return wp_load_alloptions();
[1851] Fix | Delete
}
[1852] Fix | Delete
[1853] Fix | Delete
/**
[1854] Fix | Delete
* Retrieve HTML content of attachment image with link.
[1855] Fix | Delete
*
[1856] Fix | Delete
* @since 2.0.0
[1857] Fix | Delete
* @deprecated 2.5.0 Use wp_get_attachment_link()
[1858] Fix | Delete
* @see wp_get_attachment_link()
[1859] Fix | Delete
*
[1860] Fix | Delete
* @param int $id Optional. Post ID.
[1861] Fix | Delete
* @param bool $fullsize Optional. Whether to use full size image. Default false.
[1862] Fix | Delete
* @param array $max_dims Optional. Max image dimensions.
[1863] Fix | Delete
* @param bool $permalink Optional. Whether to include permalink to image. Default false.
[1864] Fix | Delete
* @return string
[1865] Fix | Delete
*/
[1866] Fix | Delete
function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
[1867] Fix | Delete
_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_link()' );
[1868] Fix | Delete
$id = (int) $id;
[1869] Fix | Delete
$_post = get_post($id);
[1870] Fix | Delete
[1871] Fix | Delete
if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
[1872] Fix | Delete
return __('Missing Attachment');
[1873] Fix | Delete
[1874] Fix | Delete
if ( $permalink )
[1875] Fix | Delete
$url = get_attachment_link($_post->ID);
[1876] Fix | Delete
[1877] Fix | Delete
$post_title = esc_attr($_post->post_title);
[1878] Fix | Delete
[1879] Fix | Delete
$innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
[1880] Fix | Delete
return "<a href='$url' title='$post_title'>$innerHTML</a>";
[1881] Fix | Delete
}
[1882] Fix | Delete
[1883] Fix | Delete
/**
[1884] Fix | Delete
* Retrieve icon URL and Path.
[1885] Fix | Delete
*
[1886] Fix | Delete
* @since 2.1.0
[1887] Fix | Delete
* @deprecated 2.5.0 Use wp_get_attachment_image_src()
[1888] Fix | Delete
* @see wp_get_attachment_image_src()
[1889] Fix | Delete
*
[1890] Fix | Delete
* @param int $id Optional. Post ID.
[1891] Fix | Delete
* @param bool $fullsize Optional. Whether to have full image. Default false.
[1892] Fix | Delete
* @return array Icon URL and full path to file, respectively.
[1893] Fix | Delete
*/
[1894] Fix | Delete
function get_attachment_icon_src( $id = 0, $fullsize = false ) {
[1895] Fix | Delete
_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image_src()' );
[1896] Fix | Delete
$id = (int) $id;
[1897] Fix | Delete
if ( !$post = get_post($id) )
[1898] Fix | Delete
return false;
[1899] Fix | Delete
[1900] Fix | Delete
$file = get_attached_file( $post->ID );
[1901] Fix | Delete
[1902] Fix | Delete
if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
[1903] Fix | Delete
// We have a thumbnail desired, specified and existing.
[1904] Fix | Delete
[1905] Fix | Delete
$src_file = wp_basename($src);
[1906] Fix | Delete
} elseif ( wp_attachment_is_image( $post->ID ) ) {
[1907] Fix | Delete
// We have an image without a thumbnail.
[1908] Fix | Delete
[1909] Fix | Delete
$src = wp_get_attachment_url( $post->ID );
[1910] Fix | Delete
$src_file = & $file;
[1911] Fix | Delete
} elseif ( $src = wp_mime_type_icon( $post->ID, '.svg' ) ) {
[1912] Fix | Delete
// No thumb, no image. We'll look for a mime-related icon instead.
[1913] Fix | Delete
[1914] Fix | Delete
/** This filter is documented in wp-includes/post.php */
[1915] Fix | Delete
$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
[1916] Fix | Delete
$src_file = $icon_dir . '/' . wp_basename($src);
[1917] Fix | Delete
}
[1918] Fix | Delete
[1919] Fix | Delete
if ( !isset($src) || !$src )
[1920] Fix | Delete
return false;
[1921] Fix | Delete
[1922] Fix | Delete
return array($src, $src_file);
[1923] Fix | Delete
}
[1924] Fix | Delete
[1925] Fix | Delete
/**
[1926] Fix | Delete
* Retrieve HTML content of icon attachment image element.
[1927] Fix | Delete
*
[1928] Fix | Delete
* @since 2.0.0
[1929] Fix | Delete
* @deprecated 2.5.0 Use wp_get_attachment_image()
[1930] Fix | Delete
* @see wp_get_attachment_image()
[1931] Fix | Delete
*
[1932] Fix | Delete
* @param int $id Optional. Post ID.
[1933] Fix | Delete
* @param bool $fullsize Optional. Whether to have full size image. Default false.
[1934] Fix | Delete
* @param array $max_dims Optional. Dimensions of image.
[1935] Fix | Delete
* @return string|false HTML content.
[1936] Fix | Delete
*/
[1937] Fix | Delete
function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
[1938] Fix | Delete
_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );
[1939] Fix | Delete
$id = (int) $id;
[1940] Fix | Delete
if ( !$post = get_post($id) )
[1941] Fix | Delete
return false;
[1942] Fix | Delete
[1943] Fix | Delete
if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
[1944] Fix | Delete
return false;
[1945] Fix | Delete
[1946] Fix | Delete
list($src, $src_file) = $src;
[1947] Fix | Delete
[1948] Fix | Delete
// Do we need to constrain the image?
[1949] Fix | Delete
if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
[1950] Fix | Delete
[1951] Fix | Delete
$imagesize = wp_getimagesize($src_file);
[1952] Fix | Delete
[1953] Fix | Delete
if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
[1954] Fix | Delete
$actual_aspect = $imagesize[0] / $imagesize[1];
[1955] Fix | Delete
$desired_aspect = $max_dims[0] / $max_dims[1];
[1956] Fix | Delete
[1957] Fix | Delete
if ( $actual_aspect >= $desired_aspect ) {
[1958] Fix | Delete
$height = $actual_aspect * $max_dims[0];
[1959] Fix | Delete
$constraint = "width='{$max_dims[0]}' ";
[1960] Fix | Delete
$post->iconsize = array($max_dims[0], $height);
[1961] Fix | Delete
} else {
[1962] Fix | Delete
$width = $max_dims[1] / $actual_aspect;
[1963] Fix | Delete
$constraint = "height='{$max_dims[1]}' ";
[1964] Fix | Delete
$post->iconsize = array($width, $max_dims[1]);
[1965] Fix | Delete
}
[1966] Fix | Delete
} else {
[1967] Fix | Delete
$post->iconsize = array($imagesize[0], $imagesize[1]);
[1968] Fix | Delete
$constraint = '';
[1969] Fix | Delete
}
[1970] Fix | Delete
} else {
[1971] Fix | Delete
$constraint = '';
[1972] Fix | Delete
}
[1973] Fix | Delete
[1974] Fix | Delete
$post_title = esc_attr($post->post_title);
[1975] Fix | Delete
[1976] Fix | Delete
$icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";
[1977] Fix | Delete
[1978] Fix | Delete
return apply_filters( 'attachment_icon', $icon, $post->ID );
[1979] Fix | Delete
}
[1980] Fix | Delete
[1981] Fix | Delete
/**
[1982] Fix | Delete
* Retrieve HTML content of image element.
[1983] Fix | Delete
*
[1984] Fix | Delete
* @since 2.0.0
[1985] Fix | Delete
* @deprecated 2.5.0 Use wp_get_attachment_image()
[1986] Fix | Delete
* @see wp_get_attachment_image()
[1987] Fix | Delete
*
[1988] Fix | Delete
* @param int $id Optional. Post ID.
[1989] Fix | Delete
* @param bool $fullsize Optional. Whether to have full size image. Default false.
[1990] Fix | Delete
* @param array $max_dims Optional. Dimensions of image.
[1991] Fix | Delete
* @return string|false
[1992] Fix | Delete
*/
[1993] Fix | Delete
function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
[1994] Fix | Delete
_deprecated_function( __FUNCTION__, '2.5.0', 'wp_get_attachment_image()' );
[1995] Fix | Delete
$id = (int) $id;
[1996] Fix | Delete
if ( !$post = get_post($id) )
[1997] Fix | Delete
return false;
[1998] Fix | Delete
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function